Computer Hope
Microsoft => Microsoft DOS => Topic started by: alipierce on June 13, 2012, 02:08:41 PM
-
I would like to automatically fetch "get" a web page that has the date as part of its path
https://site.gov/blah/blah/decision?process_date=6%2F13%2F2012&v_dispatchid=#######&but=Reports
This is part is my problem.... 6%2F13%2F2012
As is, I have to login, click various radio buttons and prompts, until I navigate to this page.
Is there a way that cURL can find the page relative to "TODAY's DATE -1DAY"?
I'm open to suggestions... The end goal is to retrieve that web page. Thanks in advance!
-Ali
-
Is it possable you could give us the site? I don't know of any site that uses % in the url >.< but I believe all you would have to do is make a file that says:
start "~\iexplore.exe" "yourURLHere"
But I will be unable to test this until I find a site, sorry.
-
I don't know of any site that uses % in the url >.<
% signs in a URL are used for escaping certain characters. In the given URL, for example, %2F is character code 47 which is the forward slash ("/"). naturally that cannot appear as is since it would be another slash and "break" the url.
This is also part of the problem in the original post. the date is being represented as 6/13/2012, but with the slashes escaped. I guess the problem here is that the % signs have special meaning on the windows command line.
You can escape them by inserting a caret before the percent sign.
https://site.gov/blah/blah/decision?process_date=6^%2F13^%2F2012^&v_dispatchid=#######^&but=Reports
(ampersands have special meaning too, so those need to be escaped).
For getting the proper URL for the previous date, you can probably do some string processing on the output from date /t; though it would likely rely on the date format being used.
-
I guess the problem here is that the % signs have special meaning on the windows command line. You can escape them by inserting a caret before the percent sign.
The escape for a percent sign is another percent sign. Thus to achieve % you need %%. (Why don't people just use VBScript?)