Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: HTML::TreeBuilder scan for first table ( HTML::TreeBuilder::XPath )

by mr_ron (Chaplain)
on Jan 25, 2016 at 21:25 UTC ( #1153611=note: print w/replies, xml ) Need Help??


in reply to Re: HTML::TreeBuilder scan for first table ( HTML::TreeBuilder::XPath )
in thread HTML::TreeBuilder scan for first table

Sorry - Guess I got lost in the formatting of the post I replied to. I may not have seen XPath formatted this way before.

> Or even all in one xpath expression > my @headers = $tree->findvalues( q{ > ( > //table[ @class = 'HeaderFrame' ] > )[1] > //td[ @class = 'HeaderTitle' ] > } );

It's mostly my fault but maybe below is easier to follow possibly more familiar and compact?

my @headers = $tree->findvalues( '(//table[@class="HeaderFrame"])[1]//td[@class="HeaderTitle"]' );
Ron

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2022-12-04 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?