Skip to content

Instantly share code, notes, and snippets.

View gshmu's full-sized avatar

gshmu gshmu

View GitHub Profile
@gshmu
gshmu / html-parser
Last active May 25, 2017 05:50
python: bs4 html.parser self-close tag error
from bs4 import BeautifulSoup
html_str = "<html><body><p>tag-error<img src='a'><img src='b'><img src='c'></p></body></html>"
print(BeautifulSoup(html_str, 'html.parser').prettify())
__out__ = """
<html>
<body>