Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Parsing HTML/XML with Regular Expressions

by choroba (Cardinal)
on Oct 17, 2017 at 14:49 UTC ( [id://1201497]=note: print w/replies, xml ) Need Help??


in reply to Parsing HTML/XML with Regular Expressions

Using XML::XSH2 , I had to fix the script after downloading the XML: I hadn't had the namespace there, and I tried normalize-space instead of substitution which didn't work correctly.
open 1201438.xml ; register-namespace xh http://www.w3.org/1999/xhtml ; my $first = 1 ; for //xh:div[@class='data'] { if not($first) echo :n ', ' ; $first = 0; echo :s :n @id '=' xsh:subst(., '\W', '', 'g') ; } echo ;

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-23 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found