Home: Perl Programming Help: Advanced:
using WWW::Mechanize to spoof newer browser



majinserge
New User

Apr 5, 2011, 11:09 AM


Views: 4110
using WWW::Mechanize to spoof newer browser

Hi everyone.

I am writing a script that will use WWW::Mechanize to traverse a web site and get information, however this web site only lets certain browsers view it (namely Internet Explorer 4.0 or higher, Netscape 6.0 or higher, Mozilla .9 or higherOpera 5.0 or higher, Safari/Konqueror) and when I load the page in my script, it gives me an error message and says that i must use one of these browsers if i want to log into their site.

Is there any way around this? Can WWW::Mechanize be set to imitate different browsers? Thanks in advance


miller
User

Apr 5, 2011, 12:26 PM


Views: 4106
Re: [majinserge] using WWW::Mechanize to spoof newer browser

WWW::Mechanize is a subclass of LWP::UserAgent. Simply specify the 'agent' in your constructor to impersonate another browser.