📜  通过 python bs4 获取页面标题 - Python 代码示例

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

代码示例1
from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen("https://www.google.com")
soup = BeautifulSoup(html, 'html.parser')
print(soup.find('title').text)

# Check source for more details