how i can getting xpath address of a string in html code?
Posted: Wed Sep 23, 2015 1:53 am
Hi
i want know how i can getting a xpath address
of a string in html code. for example i want finding xpath of YES in this html code :
i used the http://php.net/manual/en/domnode.getnodepath.php but thats only work with tag name and not working with a word or text searching in a string.
i want getting like this result finally :
how i can doing like that ?
and is it possible doint that with php simple_html_dom parser ?
Thanks.
i want know how i can getting a xpath address
of a string in html code. for example i want finding xpath of YES in this html code :
Code: Select all
<div><div>
<div><div>
<div>
<p>NO</p>
<div>
<p>a text</p>
</div>
</div>
</div>
<div>
<div>
<p>YES</p>
<div>
<p>b text</p>
</div>
</div>
</div></div>
</div></div>i want getting like this result finally :
Code: Select all
/html/body/div/div/div/div[2]/div/pand is it possible doint that with php simple_html_dom parser ?
Thanks.