in reply to Re: WWW::Mechanize / javascript pointer
in thread WWW::Mechanize / javascript pointer

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.

  • Comment on Re^2: WWW::Mechanize / javascript pointer

Replies are listed 'Best First'.
Re^3: WWW::Mechanize / javascript pointer
by Corion (Patriarch) on Nov 12, 2009 at 12:50 UTC

    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.

        I haven't looked at processing downloads yet. If the content ends up in the browser, you can likely get at it with the ->content method, but I haven't implemented anything like downloads yet. Likely you can easily instruct FireFox to follow a link to an URI and not to prompt you where to save it.

        Patches to add that functionality are welcome.

        Update: Mozilla Development Center even has the Javascript implemented. This doesn't allow for piping the download through Perl as it arrives, but it's a start.