in reply to WWW::Mechanize / javascript pointer

Why would you want to "parse the sm"?

The link you showed and the resulting URL are identical unless the whitespace in the link you showed actually exists:

<a href="MySurvey_SummaryDownload.aspx?sm= yUsTZIyAVJQqSsTu3TSbdT0ZMzs +fbk0cbSdAOVkNUDY%3d" class="itBtn"> /MySurvey_SummaryDownload.aspx?sm=yUsTZIyAVJQqSsTu3TSbdT0ZMzsf +bk0cbSdAOVkNUDY%3d

Anyway, the general rule of thumb when automating things is to compare what your script does against what the reference does. So, compare what Wireshark gets from your browser against what it gets when you use WWW::Mechanize. Also test the site with Javascript disabled.

Replies are listed 'Best First'.
Re^2: WWW::Mechanize / javascript pointer
by spstansbury (Monk) on Nov 12, 2009 at 12:44 UTC

    Thanks for the response.

    I want the ability to parse the "sm=" because it is generated for each report and since this is javascript, I don't have a button to click, so therefore I need to parse the report identifier and build a GET statement using it.

      If the site uses Javascript, you'll have to parse it, even though your HTML looks good enough. But personally, I'd use my module WWW::Mechanize::FireFox, which understands Javascript by virtue of automating FireFox.

        Corion,

        How would you handle file downloads with W:M:F? I was looking in the docs the other day, as I'm trying to figure out how to do something similar to what the OP has described, but it requires processing a file download.