A
A
adun32015-12-15 15:31:58
XPath
adun3, 2015-12-15 15:31:58

How to "pull out" all p tags between h tags?

<h4>
<p>atata
<p>ogogo
<p>ups
<h4>

how to select all p tags between h4 tags.
i did like this: //h4[1]/following-sibling::p/preceding-sibling::h4[2]'
what's wrong? Needed to count all p, and then bypass them.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2015-12-17
@glebovgin

The following expression seems to work for me:
By the way, all p tags between all h4 tags will be collected . Then you iterate the results and work with each item() individually.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question