I’m a very new beginner with xpath and html. Is it possible to search an html for a text “xxxx” under in each class “authorbox” and if the class has it, automatically select the parent class tr.
< tr>
< td class=”authorbox”>
< div class="regsn">
< a href="/member/profile/xxxx" t="post-usersntxt">xxxx< /a>
….
and the table contiues with more
< tr>
< tr>
< tr>
EDIT
This is the xpath I’m currently able to make
//td[@class=’authorbox’]
I don’t really know how to search for text “xxxx” or select the parent tr if the text is found. I can select each table if I want to though, but it would be nice if it was more automatic.
Thanks
Use:
this selects any
trin the XML document that has atdchild whoseclassattribute’s string value is the string"authorbox"and that (thetdchild) has a text-node descendant whose string value is a string that contains"xxxx".This may be made more precise:
If the text node descendant’s string value must be exactly the string
"xxxx", then use:If the string value of the text-node descendant shoud start with the string
"xxxx", use:If the string value of the text-node descendant shoud contains the string
"xxxx"that is surrounded only by white-space, use: