Some Xpath instructions are needed. I have something along the following lines in terms of HTML. How to extract the table following the first paragraph with an image?
<p align="center"> <img src="some_image.gif" alt="Some Title"> </p> <table width="500" border="1" class="textstyle" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="4" align="center"> <b>Label</b> </td> </tr> <tr> <td align="center"> Text </td> <td align="center"> Text </td> <td align="center"> Text </td> <td align="center"> Text </td> </tr> </table> <blockquote> <p class="textstyle"> Text. </p> </blockquote>
Obviously, I would like to see how to write xpath for this, but I would also like to sort out my options through some shorthand / cheatsheet about what options exist for xpath. I was considering using something like that:
//table[preceding-sibling::p[contains(align(), "center")
or maybe something that would allow me to tell ap that is focused on img in it, however I'm just not sure where to go to get a nice complete list and an actual entry that explains all the details of gory.
source share