Having trouble getting file to save
See Resolved Section Below...
I'm attempting to save the results of the following URL:
"http://wogcc.state.wy.us/DumpByApdA.cfm?bmon=01&bday=01&byear=2001&emon=03&eday=14&eyear=2010&cType=1&Points=Y"
This URL runs fine in a browser.
However, when I run this in a scrape (attached) I get the following error:
ERROR: Failed to retrieve the file: "http://wogcc.state.wy.us/APD20010101_20100315.txt". The server returned a status code of 404.
Here is the script I call to save the file:
session.downloadFile( "http://wogcc.state.wy.us/APD20010101_20100315.txt", "e:/ges/rmoj/statefolders/WY/Notes/APD20100315.txt" );
Attached are the scrape components as TXT files.
Any ideas?
Thanks.
Addendum: I do notice that the Parameters are not being updated in the Resolved URL versus the POST data.
Starting scraper.
Running scraping session: WYOMING_RMOJ_SCRAPE_02
Processing scripts before scraping session begins.
Processing script: "WYOMING_RMOJ_SCRAPE_01_Initialize"
+++New date Month: 03
+++New date Day: 15
+++New date Year: 2010
+++New date2: 20100315
20100315
03
15
2010
Scraping file: "File from Wyoming Permits"
File from Wyoming Permits: Processing scripts before a file is scraped.
File from Wyoming Permits: Preliminary URL: http://wogcc.state.wy.us/DumpByApdA.cfm?bmon=01&bday=01&byear=2001&emon=...
File from Wyoming Permits: Using strict mode.
File from Wyoming Permits: POST data: bmon=01&bday=01&byear=2001&emon=03&eday=15&eyear=2010&cType=1&Points=Y
File from Wyoming Permits: Resolved URL: http://wogcc.state.wy.us/DumpByApdA.cfm?bmon=01&bday=01&byear=2001&emon=...
File from Wyoming Permits: Sending request.
Addendum 2:
Should I be using scrapeableFile.saveFileOnRequest for this scrape.
I'm setting my Parameters in WYOMING_RMOJ_SCRAPE_01_Initialize (Script).sss
session.setVariable("ExtractMonth",newDateMonth);
session.setVariable("ExtractDay",newDateDay);
session.setVariable("ExtractYear",newDateYear);
But they are not updating in the Parameters section of the scrape with these variable gets:
~#ExtractMonth#~
~#ExtractDay#~
~#ExtractYear#~
Resolved:
1. Found that I had left the bmon=01&bday=01&byear=2001&emon=03&eday=14&eyear=2010&cType=1&Points=Y in the call. This apparently overwrites the Parameters on call.
2. scrapeableFile.saveFileOnRequest should be used to save file.