in reply to perl Mojo DOM CSS syntax issues

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:

<r> <div class="JMWMJ"> <div class="toI8Rb OSrXXb usbThf">Sam Namett, MD - Physician - Inter +ventional Orthopedics ...Exosomes are nanovesicles (30-200 nm) found +in extracellular space of various cell types, and in biofluids; havin +g diverse functions including intracellular ... </div> <div class="Xxy7Vb"> <div class="BtwlAd"> <g-img style="width:16px;height:16px"> <img id="dimg_8" src="data:image/gif;base64,R0lGODlhAQABAI +AAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" /> </g-img> </div> </div> </div> </r>

Now to parse and grab a single element:

perl -MXML::Simple -e 'my $x = qq~./limit.html~; system cat =>$x; my $ +rx = XMLin($x); use Data::Dumper; print Dumper \$rx; print qq~\n\n$rx +->{div}->{div}->[0]->{content}~;'

Produces...

... $VAR1 = \{ + 'div' => { + 'div' => [ + { ... Sam Namett, MD - Physician - Interventional Orthopedics ...Exosomes ar +e nanovesicles (30-200 nm) found in extracellular space of vari\ ous cell types, and in biofluids; having diverse functions including i +ntracellular ...

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