I am using BeautifulSoup to extract data from HTML files. I want to get all of the information between two tags. This means that if I have an HTML section like this:
<h1></h1>
Text <i>here</i> has no tag
<div>This is in a div</div>
<h1></h1>
Then if I wanted all of the information between the first h1 and the second h1, the output would look like this:
Text <i>here</i> has no tag
<div>This is in a div</div>
I've tried nextsibling loops, but there always seems to be a catch. Is there a command in beautifulsoup that simply pulls everything (Text, newlines, divs, special characters) that is between element "A" and element "B"?