So I am working on a crawler, and some of the data I want to store about the sites I crawl is their IP address. I'd prefer to do this without having to hit their server again, so is there anyway to get this information from LWP or WWW::Mechanize after you've already requested the webpage? For instance:
my $mech = WWW::Mechanize->new();
$mech->get($url);
$ip = $mech->url_ip;
I've looked through the documentation of LWP and WWW::Mechanize and I can't seem to find anything, however I've missed things before. So does anyone know of a way to do this with one of these modules? Or even another similar module that can do it? Thanks for the help!
Using Net::DNS. Here's a simple example: