Answer the question
In order to leave comments, you need to log in
How to get elements between tags in XPath?
I have, for example, a sequence of tags
<li>1</li>
<li><div><a>2</a></div></li>
<li>3</li>
<li>4</li>
<li>5</li>
<li><div><a>6</a></div></li>
<li>7</li>
<li>8</li>
Answer the question
In order to leave comments, you need to log in
//li[div/a][1]/
following-sibling::li[div/a][1]/
preceding-sibling::li[
preceding-sibling::li[div/a]
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question