Preventing BeautifulSoup from converting my XML tags to lowercase Preventing BeautifulSoup from converting my XML tags to lowercase xml xml

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')
  • Detailed Explanation