dneedles has asked for the wisdom of the Perl Monks concerning the following question:

Well my earlier troll for getting Win32:IE:Mechanize to work with frames was a bust (besides I'd rather run the solution on UNIX. 8-) So is there a way to mimic IE via LWP or Mechanize?
  • Comment on Mimicking Internet Explorer (IE) via LWP or Mechanize?

Replies are listed 'Best First'.
Re: Mimicking Internet Explorer (IE) via LWP or Mechanize?
by Anonymous Monk on Aug 11, 2010 at 21:28 UTC
      The issue from the previous post was that WIN32:IE:Mechanize appears to not work correctly with frames. Google and perlmonk searches turned up questions back to 2005 but no real answers. So using WINE won't work

      I guess I could use a sniffer/tracer as the other solutions suggest and hack out a solution but I figured this sort of problem must have come up before. If possible I wanted to save the few days of troubleshooting.

      Is there any provisions in LWP or Mechanize for simulating a particular browser?

      Or any ideas on the original post? - http://www.perlmonks.org/?node_id=854131

      Or is RTF-packets is the only solution here

      Thanks!

        Why don't you go and read the links you've already been given? Also see what WWW::Mechanize has to say about its browser "emulation".

Re: Mimicking Internet Explorer (IE) via LWP or Mechanize?
by dneedles (Sexton) on Aug 12, 2010 at 16:00 UTC
    Ok for posterity I need to indicate how I goofed. The information was there. The right google key would have been NOT emulation or mimick or etc ... rather agent_alias.

    What I was looking for was:

    $mech->agent_alias( $alias )

    Sets the user agent string to the expanded version from a table of actual user strings. $alias can be one of the following:

    * Windows IE 6

    * Windows Mozilla

    * Mac Safari

    * Mac Mozilla

    * Linux Mozilla

    * Linux Konqueror

    then it will be replaced with a more interesting one. For instance,

    $mech->agent_alias( 'Windows IE 6' );

    sets your User-Agent to:

    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

    The list of valid aliases can be returned from known_agent_aliases(). The current list is:

    * Windows IE 6

    * Windows Mozilla

    * Mac Safari

    * Mac Mozilla

    * Linux Mozilla

    * Linux Konqueror

    I guess I didn't have my wheaties the first time through the pod. 8-P