How to scrap a block of tag using beautifulsoup?

Using beautifulsoup, is there a way to grab the content between
<p class='B'></p>
and
</div>
? The content coud be any combinations of p and ul

<div>
  <div class='A'></div>
  <p class='B'></p>
  <p>....</p>
  <ul>...</ul>
</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.