in reply to Slow WWW::Mechanize->get

Ank_:

The only theory I have is that the site is looking at the user agent string to do some things, and when it doesn't contain a 'mainstream' agent string, their site may be doing something to make it slower. To test the theory, try setting up a different agent string and see if it replies faster.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: Slow WWW::Mechanize->get
by Anonymous Monk on Jan 26, 2013 at 01:40 UTC
    Dear roboticus, I just recognized the right question to ask: How can I print/see/dump/compare WWW::Mechanize's and Firefox's user agent strings set to the site.

      From the docs:

      $mech->agent_alias('Windows Mozilla') is probably sufficient. You can use $mech->known_agent_aliases() to get a list of the agent aliases built into WWW::Mechanize.

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.

        Oh, this i tried... And more complex variations too, like: verify_hostname => 0,noproxy => 0,cookie_jar=>{'ASP.NET_SessionId'=>'ihbh5neysr4cxybrgsskbm45'},agent=>"Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0" and other possible parameters.
      read the docs :) ->res->headers->as_string
        Thanks. However to understand the difference between WWW::Mechanize and Firefox i need the headers before get( $start_page ). The $mech->res->headers->as_string is not defined there. Sorry, if i misunderstood your reply.
Re^2: Slow WWW::Mechanize->get
by Anonymous Monk on Jan 26, 2013 at 01:11 UTC
    Thanks, roboticus, will do ...