|
|
| Come for the quick hacks, stay for the epiphanies. | |
| PerlMonks |
Re: perl Mojo DOM CSS syntax issuesby InfiniteSilence (Curate) |
| on Jan 28, 2024 at 00:01 UTC ( [id://11157309]=note: print w/replies, xml ) | Need Help?? |
|
There is a bunch of stuff written in Perl that has lots and lots of functionality I do not want or need so I use the parts I want and skip the other stuff. I could rewrite it but why? In this case you have supplied us with an input file that does not appear to be valid HTML, is incomplete, or both. I took the libertty of closing a few tags just to get the parser to stop complaining:
Now to parse and grab a single element:
Produces...
The most interesting part being print qq~\n\n$rx->{div}->{div}->[0]->{content}~; My point is this: if your input is legit then parsing and extracting from it becomes easier. Perhaps rather than rewrite a big script work on cleaning up the input for now and work on the script later when you have more time. Celebrate Intellectual Diversity
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||