Scrape text between 2 <h1>

Hello there,

just a quick question for you guys.
Let's imagine a page where there are several <h1 id="name"> and then one or several <p>
I would like to scrap the text from the <p>.
I know the id of the <h1> I want but not the number of <p>. The last <p> will be followed by another <h1 id=name2>

Something like that :

<h1 id="name">
<p> text <p>
<p> text <p>
<p> text <p>
...
`<h1 id=name2>`

Of course the <h1 id="name"> is never at the same place on the several pages and never followed by the same h1.

I tried something like : h1#id+ p
But the number of p is not always the same.

So I need to get any text in p following a specific h1 id until the next h1.

Hope it was clear.
Thank by advance for your help
Bye

The h1 tags would normally be followed by closing tags </h1>
So you can grab all the text in between by using something like:

h1[id]

which will match any h1 with the id attribute (ignores the names). If you only want the text from the first <p> try:

h1[id] + p