Skip to content

Instantly share code, notes, and snippets.

Avatar

gshmu gshmu

View GitHub Profile
@gshmu
gshmu / html-parser
Last active May 25, 2017
python: bs4 html.parser self-close tag error
View html-parser
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>