📜  美丽的汤得到特定的类 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:36.260000             🧑  作者: Mango

代码示例2
from bs4 import BeautifulSoup

# after storing your HTML text in html_text 
# (lack of fantasy, ok, you got a point)
soup = BeautifulSoup(html_text, "html.parser")

# it will return a list of 'bs4.element.Tag' 
# with class your_class_name
results = soup.find_all(class_ = "your_class_name")