想要获取 a标签里的单词如下所示。 代码 from bs4 import BeautifulSoup f = open("word.txt", "r") # 设置文件对象 html = f.read() # 将txt文件的所有内容读入到字符串html中 soup = BeautifulSoup(html, 'lxml') # 获取a标签里的文本内容 ...