tags:

views:

188

answers:

2

I have some input with a link and I want to open that link. For instance, I have an HTML file and want to find all links in the file and open their contents in an Excel spreadsheet.

+1  A: 

That sounds like a job for WWW::Mechanize. It provides a fairly high level interface to fetching and studying web pages.

Once you've read the docs, I think you'll have a good idea how to go about it.

jplindstrom
use WWW::Mechanize; my $mech = WWW::Mechanize->new( autocheck => 1 );$mech->get( "http://www.google.com" );print $mech->content;GETTING ERRORError GETing http://www.google.com: Can't connect to www.google.com:80 (connect:Unknown error)I WANT TO KNOW WHAT IS WRONG.
lokesh
google.com is special. It doesn't like robots. However, it sounds like you have a network issue if you can't even connect.
brian d foy
+2  A: 

It sounds like you want the linktractor script from my HTML::SimpleLinkExtor module.

You might also be interested in my webreaper script. I wrote that a long, long time ago to do something close to this same task. I don't really recommend it because other tools are much better now, but you can at least look at the code.

CPAN and Google are your friends. :)

brian d foy