Related example macro: Demo-ImageDownload
To download an image (or any other specific web page element) switch to recording mode, navigate to the page and press
in the iMacros Browser or
in the Internet Explorer Plug-In.
The item download preview opens in the tab on the left. Next, select the image or item in the web browser window. The selection is then displayed in the preview section. If you like the selection, press ok. The item download manager automatically adds a TAG line to your macro, e.g.:
TAG POS=1 TYPE=IMG ATTR=HREF:http://www.iopus.com/logo.jpg CONTENT=EVENT:SAVEITEM
You can also create download tag lines manually: During recording, simply click on the wanted item and add CONTENT=EVENT:SAVEITEM to the generated TAG line in an editor of your choice.
The downloaded files are copied to the iMacros download directory (usually C:\Program Files\iMacros\downloads\). The items are taken directly from the web browser that displayed them. They are not downloaded again to save time and bandwidth. The naming convention for downloaded images is the same as for downloaded files, i.e. they consists of the original file name and a date and time tag. This also means you can use the ONDOWNLOAD command to specify your name for the downloaded image.
You can also download images using SAVEPICTUREAS. The command is named after the corresponding functions in the Internet Explorer menu, "Save Picture as". You can right-click on any web page element to see if the web page element supports this feature; if it does, iMacros can handle it automatically for you. To create such a command, click on the element you would like to save during record and add CONTENT=EVENT:#SAVEPICTUREAS manually to the generated TAG command. To control the location and name of the downloaded file, use the ONDOWNLOAD command.
Page URL http://www.iopus.com/imacros/help/image_downlaod.htm