Code
<div id="content">
<div class="sample">sample text</div>
<div class="datebar">
<span style="float:right">some text1</span>
<b>some text2</b>
</div>
<p>paragraph 1</p>
<p>paragraph 2</p>
</div>
I want to get data that in <p> tags or you can say that is coming after <div class="datebar">.
Would achieve what you’re asking for with your provided sample.
Update
If you only wanted those
<p>that came after<div class="datebar">. The following should work:Another Update – For Kirill
Here’s a sample of HTML which has an extra
<p>before<div class="datebar">and xpath expressions tested using python.Obviously, the solution depends on what the full input HTML is and what the OP wants to extract, neither of which are clear at the moment.
Kirill’s expression of
//div[@id = 'content' and div[@class = 'datebar']]/p/text()does not selectAs stated in his comments.