Get a single element with PHP and XPath

Posted by daliz on Stack Overflow See other posts from Stack Overflow or by daliz
Published on 2010-04-05T11:20:07Z Indexed on 2010/04/05 11:23 UTC
Read the original article Hit count: 222

Filed under:
|
|
|

Lots of tutorials around the net but none of them can explain me this:

How do I select a single element (in a table, for example), having its absolute XPath?

Example: I have this:

/html/body/table/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr/td/table/tbody/tr[3]/td/table/tbody/tr[4]/td[5]/span

What's that PHP function to get the text of that element?! Really I could not find an answer. Found lots of guides and hints to get all the elements of the table, all the buttons of a form, etc, but not what I need.

Thank you.

© Stack Overflow or respective owner

Related posts about xpath

Related posts about single