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
相關文章
相關標籤/搜索