我想使用一个文本文件作为源文件,在该文件中我有我的html标记,而不是实际的站点((sauce=urllib.request.urlopen('https://sitex.com').read()
,在该站点中我有文件中的标记。你知道吗
import urllib.request
import bs4
import requests
with open('words.txt','r') as f:
soup =BeautifulSoup (r.text, "html.parser")
for line in f:
print(soup.find_all("a"))
像这样?你知道吗
你知道吗文字.txt地址:
然后:
输出:
相关问题 更多 >
编程相关推荐