Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to select elements between two tags
    text
    copied!<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/7957480/xpath-select-elements-between-two-nodes">xpath select elements between two nodes</a> </p> </blockquote> <p>based on this html i need two xpath expressions:</p> <pre><code>&lt;table dir = "rtl ......."&gt; &lt;tbody&gt; &lt;script src = "get.aspx?type=js&amp;file=ajax&amp;rev=3"......&gt; &lt;script language = "JavaScript" src = "get.aspx?type=js&amp;file=mc&amp;rev=6"&gt;&lt;/script&gt; &lt;script&gt;..&lt;/script&gt; &lt;tr&gt; &lt;td class = "d2"...&gt;..&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;..&lt;/tr&gt; &lt;-- &lt;tr&gt;..&lt;/tr&gt; &lt;-- &lt;tr&gt;..&lt;/tr&gt; &lt;-- first expression should select these elements &lt;tr&gt;..&lt;/tr&gt; &lt;-- &lt;tr&gt;..&lt;/tr&gt; &lt;-- &lt;tr&gt;..&lt;/tr&gt; &lt;-- &lt;tr&gt;..&lt;/tr&gt; &lt;-- &lt;tr&gt; &lt;td class = "d2"...&gt;..&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;..&lt;/tr&gt; &lt;-- &lt;tr&gt;..&lt;/tr&gt; &lt;-- &lt;tr&gt;..&lt;/tr&gt; &lt;-- second expression should select these elements &lt;tr&gt;..&lt;/tr&gt; &lt;-- &lt;tr&gt;..&lt;/tr&gt; &lt;-- &lt;tr&gt;..&lt;/tr&gt; &lt;-- &lt;tr&gt;..&lt;/tr&gt; &lt;-- &lt;/tbody&gt; </code></pre> <p>how i can select all <code>&lt;tr&gt;</code> elements after the first <code>&lt;td class = "d2"...&gt;</code> tag with an xpath expression and all <code>&lt;tr&gt;</code> elements after the second <code>&lt;td class = "d2"...&gt;</code> tag with other xpath expression.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload