in reply to WWW::Mechanize and Cookies generated through Javascript

This question comes up quite often here on perlmonks so you might search for relevant threads with Super Search

AFAIK you could either decipher the javascript yourself and just mimic what the javascript does, or use WWW::Mechanize::Firefox which uses firefox for the execution of the javascript. Alternatively WWW::Selenium is able to execute the javascript too (see also the tutorial Using WWW::Selenium To Test Or Automate An Ajax Website)

  • Comment on Re: WWW::Mechanize and Cookies generated through Javascript

Replies are listed 'Best First'.
Re^2: WWW::Mechanize and Cookies generated through Javascript
by shanu_040 (Sexton) on Aug 04, 2010 at 04:42 UTC
    Hi,

    As I am using this code to create a proxy server through url rewriting. The code works fine for displaying requested site. But when I try to login through web-browser, then problem starts. And I find that is because of cooikes. Please guide me that I am on right track or not.

    I am trying something like URL Rewriting

    Any further guidance would appreciable.

    Thanks

      The link you posted only tells about how to reroute a connection attempt to a proxy, not how the proxy itself should work. It doesn't change the validity of my and rowdogs answers. Have you tried WWW::Scripter? Have you tried to disassemble the javascript code?

        I found that it not the cookies that causing the problem..It the post request. How can I handle post method in mechanize.

        I also like to know how it works..I posted the code which works in same. When I submit the login page then problem starts due to form method POST. If I replace post to get it works well

      I found that it not the cookies that causing the problem..It the post request. How can I handle post method in mechanize.

      I also like to know how it works..I posted the code which works in same. When I submit the login page then problem starts due to form method POST. If I replace post to get it works well