in reply to Re: Browsing php pages properly?
in thread Browsing php pages properly?

It is javascript that is doing the redirect.

My issue is focused around being able to see what url the server has pushed. If the only option is to use the IE::Mechanize module to launch an IE instance to see the pushed url then so be it, but is there by chance a way to have perl 'sit back and wait' like a browser to accept data from a server side push like this?

Replies are listed 'Best First'.
Re^3: Browsing php pages properly?
by ikegami (Patriarch) on Feb 01, 2006 at 16:58 UTC

    No, because LWP doesn't look at the response body, and because WWW::Mechanize doesn't pass the JavaScript to a JavaScript engine. I think there's is a project to create a JavaScript engine in Perl, but I don't know its status.

    Now, if you're only dealing with a single .php (or a set that behave identically), you could search the JavaScript code for the URL using a simple regexp, then fetch that page yourself.

      I cannot search the java code for the url since the returned url is generated at the time of calling the link from the 1st page. The data after the '=' in the url is used to generate the page itself when called by the browser.

      After looking over the IE::Mech module, that looks like it will work for what I need. The integration of the OLE module will let me grab the pushed url and I should be ok at that point.

      ikegame, thanks for the info, especially the reference to IE::Mech. I hadn't come across that one before and would not have even thought about doing this that way.