Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
However, I'm having a brain fart and cannot figure out how to do the inverse, getting all links NOT in the current domain?use strict; use Data::Dumper; use WWW::Mechanize; my $mech = new WWW::Mechanize; $mech->get('http://example.com/'); my $hostname = quotemeta( $mech->uri()->host ); my @inbound_links = $mech->find_all_links( url_abs_regex => qr!^https?://$hostname/! ); print Dumper(\@inbound_links);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Get all outbound links with WWW::Mechanize?
by Corion (Patriarch) on Mar 23, 2011 at 15:43 UTC | |
|
Re: Get all outbound links with WWW::Mechanize?
by educated_foo (Vicar) on Mar 23, 2011 at 15:43 UTC |