html - XPath in PHP - Find in Document Specific Element with Id -
everyone.
i have html document contains very-nested element unique id.
can xpath find element? want print inner text.
if not, have specify? location in document, tag, etc.?
i've tried build queries, don't work. i'm not 100% sure i'm doing.
i'm bit rusty xpath, explanations on how works useful.
thanks lot in advance, gal.
"can xpath find element?"
yes can. without further details on context, can suggest :
//*[@id='your_unique_id_value_here']
the above xpath means, find elements (should 1 anyway since id
unique described), whatever name, id
attribute value equals "your_unique_id_value_here"
.
more introductory explanations on xpath : https://en.wikipedia.org/wiki/xpath
Comments
Post a Comment