fraizerangus has asked for the wisdom of the Perl Monks concerning the following question:
Apologies but 2 questions for you today regarding WWW:Mechanize:
1) When using the $mech->follow_link(...) $mech->find_link( ... ) if one wanted more than 1 conditional for selecting links what would the syntax be for doing this e.g
my @cgi_links = $mech_cgi->find_all_links( url_regex => qr/protein/ );
but the following does'nt?
my @cgi_links = $mech_cgi->find_all_links( url_regex => qr/(protein && + amino)/ );
Can anyone point me in the right direction or know the answer?
2) what is the best practice for only following/selecting the same link once and not following it again multiple times if the link is present more than once on a web-page?
many thanks and best wishes
Dan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW:Mechanize conditional finding/following links and redundant link avoiding?!
by roboticus (Chancellor) on Oct 24, 2011 at 19:02 UTC |