xpath - Select element by sibling content -


<p>     <strong>         <span>content</span>     </strong> </p>  <table>  </table> 

as shown, table element target want select, while thing can make sure text content in preceding sibling not change.

so possible select table according content css or xpath?

there variants of xpath find same table element, considering little html snippet. personally, i'll possibly use 1 of following :

//p[normalize-space()='content']/following-sibling::table[1]  //p[strong/span/span='content']/following-sibling::table[1]  //span[text() = 'content']/following::table[1] 

Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -