I'm new to Perl/HTML things. I'm trying to use $mech->get($url)
to get something from a periodic table on http://en.wikipedia.org/wiki/Periodic_table but it kept returning error message like this:
Error GETing http://en.wikipedia.org/wiki/Periodic_table: Forbidden at PeriodicTable.pl line 13
But $mech->get($url)
works fine if $url
is http://search.cpan.org/.
Any help will be much appreciated!
Here is my code:
#!/usr/bin/perl -w
use strict;
use warnings;
use WWW::Mechanize;
use HTML::TreeBuilder;
my $mech = WWW::Mechanize->new( autocheck => 1 );
$mech = WWW::Mechanize->new();
my $table_url = "http://en.wikipedia.org/wiki/Periodic_table/";
$mech->get( $table_url );