📅  最后修改于: 2022-03-11 14:52:51.806000             🧑  作者: Mango
>>> from bs4 import BeautifulSoup
>>> soup = BeautifulSoup("SomebadHTML")
>>> print soup.prettify()
Some
bad
HTML
import re
print(soup.find_all(re.compile("(p|div)")))