Skip to content

Commit 0ca6d9d

Browse files
simbabqueoalders
authored andcommitted
update FAQ #189
1 parent 1c3c2a6 commit 0ca6d9d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Changes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Revision history for WWW::Mechanize
44
[ENHANCEMENTS]
55
- WWW::Mechanize no longer taints the responses it receives. This also
66
removes Test::Taint as a prerequisite.
7+
[DOCUMENTATION]
8+
- Improve FAQ (GH#189) (Julien Fiegehenn)
79

810
2.19 2024-09-16 15:25:45Z
911
[DOCUMENTATION]

lib/WWW/Mechanize/FAQ.pod

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,4 +446,15 @@ keeps a clone of the full Mech object at every step along the way.
446446
You can limit this stack size with the C<stack_depth> param in the C<new()>
447447
constructor. If you set stack_size to 0, Mech will not keep any history.
448448

449+
=head2 How do I find all the links in a sub-section of a page?
450+
451+
If you want to find all the links between two specific parts of content in
452+
page, you need to modify the content to remove everything else. This is a bit unorthodox,
453+
but it works.
454+
455+
my $html = $mech->content;
456+
$html =~ s/.*(\n[^n]+foo.*bar[^\n]+).*/$1/ms;
457+
$mech->update_html( $html );
458+
$mech->dump_links;
459+
449460
=cut

0 commit comments

Comments
 (0)