Combining Class and Nth-Child in Perl TreeBuilder and XPath -


i trying sum of column in html table. first row of table titles. every cell of every row past first has class "right", going use class selector ignore unnecessary titles. however, need second cell of each row. how combine these 2 selectors? right?

my $tree = html::treebuilder::xpath->new_from_file($filename); foreach $value ($tree->findnodes('//table/tr/td[@class="right"[position()=2]')){     stuff; } 

you can combine predicates putting 1 after another:

//table/tr/td[@class="right"][2] 

or, can use logical and

//table/tr/td[@class="right" , position()=2] 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -