libwww-perl / WWW-Mechanize

Handy web browsing in a Perl object
https://metacpan.org/pod/WWW::Mechanize
Other
68 stars 52 forks source link

Say how to process just a part of a page #189

Open spazm opened 7 years ago

spazm commented 7 years ago

jidanni reported on Dec 19, 2010

Please add this to the update_html documentation on the man page:

Q: How do I find all the links between the HTML containing text
NERDSBERG and TURDSBERG ?

A: Use something like
my $html = $mech->content;
$html =~     s/.*(\n[^n]+NERDSBERG.*TURDSBERG[^\n]+).*/$1/ms;
$mech->update_html( $html );
$mech->dump_links;

Q: OK, then how about for each such pair on the page? [Bonus FAQ]

Details

Imported from Google Code issue 193 via archive

Comments

petda...@gmail.com commented on Apr 24, 2011 :

(No comment was entered for this change.)

petda...@gmail.com commented on May 4, 2011 :

(No comment was entered for this change.)