index.html如下图所示,用BeautifulSoup解析该网页 with open("index.html", "r", encoding = 'UTF-8') as html: soup = BeautifulSoup(html.read()) tag = soup.select('body > img:nth-child(4)')[0] print(tag.get('title')) 打印结果是 。
index.html如下图所示,用BeautifulSoup解析该网页 with open("index.html", "r", encoding = 'UTF-8') as html: soup = BeautifulSoup(html.read()) tag = soup.select('body > img:nth-child(4)')[0] print(tag.get('title')) 打印结果是 。
发布时间:2024-11-11 16:04:21