Preventing BeautifulSoup from converting my XML tags to lowercase
No, that's not a built-in option. The source is pretty straightforward, though. It looks like you want to change the value of encodedName in Tag.__str__.
- Simple Answer
- change (default
html.parser
) to xml parser- code:
soup = BeautifulSoup(yourXmlStr, 'xml')
- code:
- change (default
- Detailed Explanation
- refer my answer in another post