I would like to parse the content of the following div element with BeautifulSoup (bs4):
<div><!--block--> Some text is here <br> - Another text <br> - More text <br> </div>
I need an ordered list of the content. The list shall contain the following items for this case:
- non-breaking space
- non-breaking space
- text data
- br
- non-breaking space
...
- non-breaking space
Using tag.find_all() I can get a list of tags like "br" but all other data such as non-breaking space or text data is not returned by tag.find_all().
tag.contents is what I was looking for.