我想刮一个网站的内容是请求异步和不可见的源代码。
我如何等待网站的要求?我需要闻一闻它的交通,但什么也找不到。
我看上去有点像(伪代码):
import requests
from bs4 import BeautifulSoup
page = requests.get("http://target.tld")
traffic = page.sniff_traffic(seconds=10)
for req in traffic:
print(req) # http://api.target.tld
soup = BeautifulSoup(page.content, "html.parser")有什么想法吗?
发布于 2022-11-05 15:50:57
您不能在BeautifulSoup中这样做,您需要使用类似于web浏览器的东西,比如在Geckodriver中使用Selenium。
https://stackoverflow.com/questions/74329133
复制相似问题