Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: searching for one or more instances of text between tags

by choroba (Cardinal)
on Oct 13, 2015 at 08:52 UTC ( [id://1144654]=note: print w/replies, xml ) Need Help??


in reply to searching for one or more instances of text between tags

Don't use regular expressions to parse HTML. Use a tool that already knows how to parse HTML. For example, here's how you can get the desired output in XML::XSH2, a wrapper around XML::LibXML:
open :F html file.html ; echo xsh:join('; ', //ul[@class='test']/li/a) ;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-20 03:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found