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>