from bs4 import BeautifulSoup
soup = BeautifulSoup(web_code, "lxml") #解析网页数据,得到BeautifulSoup对象
soup.title
soup.select("html > head > title") # 通过绝对路径寻找
soup.select("body a") # 相对路径写法
from bs4 import BeautifulSoup
soup = BeautifulSoup(web_code, "lxml") #解析网页数据,得到BeautifulSoup对象
soup.title
soup.select("html > head > title") # 通过绝对路径寻找
soup.select("body a") # 相对路径写法