xueqiu的数据无法抓取
发现雪球的网站厉害了,用python + selenium无法抓取,然后听说了一个大神器 python + mitmproxy + chrome浏览器 ,结果发现,还是会被ban,我想知道雪球是如何探测chrome被程序操控的呢?
cat addons.py
import mitmproxy.http
from mitmproxy import ctx
url_paths = '/s/?page='
class Jobinfo:
def response(self, flow: mitmproxy.http.HTTPFlow):
if flow.request.path.startswith(url_paths):
text = flow.response.get_text()
file_handle=open('target.txt',mode='a')
file_handle.write(text)
file_handle.write('\n')
file_handle.write('\n')
file_handle.close()
return
addons = [Jobinfo()]
开启
mitmdump -s addons.py
开启浏览器
google-chrome --proxy-server=127.0.0.1:8080 --ignore-certificate-errors
下面的链接打开后
https://xueqiu.com/s/?page=1&...
target.txt没有需要的那个表格数据,都是其他的东东
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论