BeautifulSoup 获取 a标签里的文本内容

说明 想要获取 a标签里的单词以下所示。html 代码 from bs4 import BeautifulSoup f = open("word.txt", "r") # 设置文件对象 html = f.read() # 将txt文件的全部内容读入到字符串html中 soup = BeautifulSoup(html, 'lxml') # 获取a标签里的文本内容 for item in
相关文章
相关标签/搜索