Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
I am doing only HTML parsing for locating the field elements with in a web page from form tag. I trying to find the complete path of a form element example Input Text fields from its Form tag. I am using ancestor function to get the complete path. example ancestor function returns the path for input text field is
"form table tr td input"
But i want is positions of these elements in the path with respect to its parent like
"form table tr td input".
like first table from from and 1st tr from the table and 2nd td from tr so on..
If it is not possible to get the complete path with positions atleast
Is there any way to get the position of element without looping through all the elements of a node.
Any help is hightly appreciated
Thanks in advance
The w3c implementation of Node does not have a method to get a unique path.
The simplest thing to do is probably to write your own getUniquePath() function as suggested on this site:
Thank you very much. It meets my requirement.