Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: HTML content editing using HTML::TreeBuilder

by Tux (Canon)
on Apr 10, 2019 at 07:58 UTC ( [id://1232391]=note: print w/replies, xml ) Need Help??


in reply to HTML content editing using HTML::TreeBuilder

edit: now that the OP has removed the code snippet that he/she posted in the original question, my reply makes no sense anymore.

Looks overly complicated to find a tags where the href matches something

foreach my $a ($root->look_down (_tag => "a", href => qr{some url matc +h})) { say "Found a tag with href to ", $a->attr ("href"), " and text ", +$a->as_text; }

and move from there


Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1232391]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-24 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found