XPath: Get node below another node
I'm new to XPath, and I need to get the table node after the following:
<p><b>Some unique string</b></p>
<center><table>
<tr>
<th>.....
I have been tryin开发者_开发问答g things such as:
"following-sibling::.//p//b[.='Some unique string']"
".//p//b[.='Some unique string']/following:://table"
So far I've managed to get rather stuck and confused, would greatly appreciate a pointer in the right direction. So thank you in advance :)
(If it makes a difference, I'm using the lxml.html module in Python 2.6)This XPath 1.0 expression:
//b[.='Some unique string']/following::table[1]
Meaning: the first following table
element of any b
element in the whole document having 'Some unique string' as string value
精彩评论