I've created an xpath expression as follows:
/html/body/div[2]/div/ul[2]/li/a/node()
It returns something like this:
#01 <strong&开发者_如何转开发gt;value</strong> suffix
How do I extract the "#01" part and the "suffix" part in two different xpath expressions?
i think you'd get the 'strong' node then use previous-sibling and following-sibling axes
/html/body/div[2]/div/ul[2]/li/a/strong/previous-sibling::node()
/html/body/div[2]/div/ul[2]/li/a/strong/following-sibling::node()
Might not be absolutely right - bit rusty on xpath!
精彩评论