Multi Web Image Download......

Dear.

i have to download one or more images in web page.
i just know it that 's possible from Session.DownloadFile(a, b) method.

please explain the detail how to do.
sorry for many question.

bye. :oops:

Multi Web Image Download......

jigong,

Let's use the screen-scraper.com homepage as an example. For example, in your extractor text you have the following HTML.

<td align="right"><a href="/support/search.php"><img src="/media/search-box_off.png" border="0" title="Search" alt="Search" /></a></td>

You would add a token for the part of the URL that is available here.

<td align="right"><a href="/support/search.php"><img src="~@IMAGE_URL_END@~" border="0" title="Search" alt="Search" /></a></td>

You would then construct the rest of the parameters needed based on information you should already have in a script that gets called some time after the IMAGE_URL_END token successfully extracts data. In this example we would have saved value of the token data in a session variable - but you may also reference the value of the extracted data via dataRecord.get(), instead. The local path and what you name the file is entirely up to you.

session.downloadFile&#40; "http&#58;//www.screen-scraper.com/" + session.getVariable&#40;"IMAGE_URL_END"&#41;, "C&#58;//whereIputMyImages//ssSearch.png" &#41;;

One thing to note in the local path is the double forward slashes. This is a best-practices approach since the slashes need to be escaped out and using forward slashes worked on Windows and Unix-based systems.

If you were not able to identify what the first part of the URL is, or because the first part can vary or change, you can use the getCurrentURL method.

http://screen-scraper.com/support/docs/api_documentation.php#getCurrentURL

This requires some string parsing, so this link to Java's API on the String Class may prove useful.

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html

I hope this helps.

-Scott

thanks........i aleady know it...

Dear swilsonmc.

i aleady know it.
but i dont know how can i get the image url of scraped source in scrapable file.

i want to get the images in the newspaper.
there are one or more images.

i get the source in ~@CONTENT@~
our images is in the session variable CONTENT.
how can i get them?

thanks.

Multi Web Image Download......

jigong,

You'll want to reference the documentation on the downloadFile method here.

http://screen-scraper.com/support/docs/api_documentation.php#downloadFile

Simply, use the URL and file system path for your situation and call the method in a script.

Please let me know what specific questions you may have.

Thanks,
Scott