Trouble Downloading Images with session.downloadFile

I have been unable to get the session.downloadfile script to work. I am using the professional trial version 2.7.2. Thanks in advance for any help you can provide.

I have the following as a script:

session.downloadFile( "http://www.hodgesmarine.com/images/express_shipping_jet.jpg", "C:\temp\test.jpg" ));

The log from the scrape session does not show any errors. The error log in the \log\ directory shows the following:

The following error occurred: String index out of range: -2
java.lang.StringIndexOutOfBoundsException: String index out of range: -2
at java.lang.String.substring(Unknown Source)
at com.screenscraper.scraper.ScriptContext.fixErrorMessage(ScriptContext.java:567)
at com.screenscraper.scraper.ScriptContext.process(ScriptContext.java:522)
at com.screenscraper.scraper.ScriptInstances.processScripts(ScriptInstances.java:666)
at com.screenscraper.scraper.ScrapeableFile.processScriptInstances(ScrapeableFile.java:2000)
at com.screenscraper.scraper.ScrapeableFile.extractData(ScrapeableFile.java:2505)
at com.screenscraper.scraper.ScrapeableFile.scrape(ScrapeableFile.java:2113)
at com.screenscraper.scraper.ScrapingSession.scrapeFile(ScrapingSession.java:1975)
at com.screenscraper.scraper.Scraper.scrape(Scraper.java:200)
at com.screenscraper.scraper.Scraper.run(Scraper.java:110)

Best Regards,
Tim

Trouble Downloading Images with session.downloadFile

Hi Tim,

The scripts can be a bit funny about how folder delimiters are handled (it also looks like you have a spare parenthesis tacked on the end). Try changing this:

session.downloadFile( "http://www.hodgesmarine.com/images/express_shipping_jet.jpg", "C:\temp\test.jpg" ));

to this:

session.downloadFile( "http://www.hodgesmarine.com/images/express_shipping_jet.jpg", "C:/temp/test.jpg" );

Also, you're seeing a big ugly error message because of a bug that we fixed after version 2.7.2 was released. You might consider upgrading to the very latest alpha version of screen-scraper, which has proven to be very stable. You can find instructions on doing that here: [url]http://blog.screen-scraper.com/2006/12/28/version-27223a-of-screen-scraper-available/[/url].

Kind regards,

Todd Wilson