Parsing XML with html unescape

6 views
Skip to first unread message

Deloo

unread,
Oct 31, 2025, 9:29:08 AM (6 days ago) Oct 31
to beautifulsoup
Hello,

in my use case, I need to parse a perfectly valid classic xml object using beautiful soup, except for the fact that the raw xml string contains html escapes.

For now, I managed to have bs properly parse the string with this line of code:
soup = bs.BeautifulSoup(html.unescape(xml), 'xml')

I wonder if there's a builtin way to achieve the same result without needing the html.unescape library function.

Thanks!
Reply all
Reply to author
Forward
0 new messages