user1700840
user1700840

Reputation: 451

Beautifulsoup 4 prettify outputs XHTML, not HTML

I'm trying to parse and prettify a bunch of files made with Microsoft FrontPage. Beautifulsoup parses them with no problem, but when I try to print the output with prettify(), tags like <meta> or <br> are rewritten as <meta ... /> and <br/>.

Is there a way to force HTML output?

Upvotes: 4

Views: 2496

Answers (1)

Martijn Pieters
Martijn Pieters

Reputation: 1121306

No, there is no way to force the .prettify() method to not output XHTML-compliant HTML.

Upvotes: 2

Related Questions