Dear expert - I try to use the code as below to get the website htm source and it works. However, I cannot get the result when I visit the website by using code as below. But, I can access this page by using browser properly. Would you give me some hints or tips to fix this problem? Thank you.


use strict;
use warnings;

# create a new browser
use WWW::Mechanize;
my $browser = WWW::Mechanize->new();

# tell it to get the main page

my $sURL = '';

#my $sURL = '';


print $browser->content;


You can try by setting the user-agent.

use WWW::Mechanize;
my $mech=WWW::Mechanize->new();
$mech->agent_alias( 'Windows IE 6' );

For more list of user agents try - perldoc WWW::Mechanize
Also see this page for known issues.