0
如何获取html标记与美丽的内容?例如<title>
标签的内容?python beautifulsoup获取html标记内容
我想:
from bs4 import BeautifulSoup
url ='http://www.websiteaddress.com'
soup = BeautifulSoup(url)
result = soup.findAll('title')
for each in result:
print(each.get_text())
但是什么都没有发生。我正在使用python3。
谢谢你有帮助:) – niloofar
@niloofar很高兴能帮到你! –