Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: cURL help: need to get page with varying date  (Read 4726 times)

0 Members and 1 Guest are viewing this topic.

alipierce

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Unknown
    cURL help: need to get page with varying date
    « 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

    Lemonilla



      Apprentice

    • "Too sweet"
    • Thanked: 70
    • Computer: Specs
    • Experience: Experienced
    • OS: Windows 7
    Re: cURL help: need to get page with varying date
    « Reply #1 on: June 14, 2012, 08:08:46 PM »
    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:
    Code: [Select]
    start "~\iexplore.exe" "yourURLHere"
    But I will be unable to test this until I find a site, sorry.
    Quote from: patio
    God Bless the DOS Helpers...
    Quote
    If it compiles, send the files.

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: cURL help: need to get page with varying date
    « Reply #2 on: June 14, 2012, 08:33:33 PM »
    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.

    Quote
    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 was trying to dereference Null Pointers before it was cool.

    Salmon Trout

    • Guest
    Re: cURL help: need to get page with varying date
    « Reply #3 on: June 14, 2012, 11:48:21 PM »
    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?)