i am new to perl...
i tried this module mechanize. this is the script
Expand|Select|Wrap|Line Numbers
- #!/usr/bin/perl
- # Include the WWW::Mechanize module
- use WWW::Mechanize;
- # What URL shall we retrieve? [I HAVE TRIED DIFFERENT URLS ALSO]
- $url = "http://www.example.com/bestselling.html";
- # Create a new instance of WWW::Mechanize
- # enabling autoheck checks each request to ensure it was successful,
- # producing an error if not.
- my $mechanize = WWW::Mechanize->new(autocheck => 1);
- # Retrieve the page
- $mechanize->get($url);
- # Assign the page content to $page
- my $page = $mechanize->content;
- # Output the page
- print $page;
- # Let's also save the page locally
- open(FH, ">bestsellers.txt");
- print FH $page;
- close(FH);
================================================== ==============
Error GETing http://www.example.com/bestselling.html: Can't connect to www.example.com:80 (Bad hostname 'www.example.com').
SOLUTION TRIED FROM USER GROUPS
================================================== ==============
1) i have turned off firewall with /etc/init.d/iptables stop
2) i have checked the error log file
[Wed Feb 06 10:00:09 2008] [notice] core dump file size limit raised to 18446744073709551615 bytes
[Wed Feb 06 10:00:10 2008] [notice] Digest: generating secret for digest authentication ...
[Wed Feb 06 10:00:10 2008] [notice] Digest: done
[Wed Feb 06 10:00:11 2008] [notice] Apache/2.0.46 (Red Hat) configured -- resuming normal operations
================================================== ================
BUT STILL I DONT KNOW HOW TO RECTIFY
I HAVE TRIED LWP::Simple module also but this is showing error 500.
give me some suggestion to rectifiy this
Suresh