从需要身份验证的网站上抓取数据 [selenium 不工作],我可以拦截来自 .NET 的 chrome 请求吗?

问题描述

我正在尝试在 etoro 上监控我的投资组合。

虽然使用此答案提供的方法获取通用数据非常容易 Is there a method to find the plot graph data in a web page?

获取特定于我的用户的数据更为复杂。似乎他们阻止了 selenium(我自己尝试过,但 SO 上的许多人也面临同样的问题)。

通过 Chrome 发出的以下请求返回我要查找的数据。我想复制请求或从 chrome 拦截它(就像 fiddler 通常所做的那样)。但是如何?有方法可以试试吗?

:authority: www.etoro.com
:method: GET
:path: /api/logininfo/v1.1/logindata?client_request_id=*secretcode*&conditionIncludedisplayableInstruments=false&conditionIncludeMarkets=false&conditionIncludeMetadata=false&conditionIncludeMirrorValidation=false
:scheme: https
accept: application/json,text/plain,*/*
accept-encoding: gzip,deflate,br
accounttype: Real
authorization: *long secretcode*
cache-control: no-cache
cookie: **; G_ENABLED_IDPS=google; etoroHPRedirect=1; __cfruid=***; __cflb=***; ***; __cf_bm=****; ***=***; TMIS2=****
pragma: no-cache
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: same-origin
x-csrf-token: *secretcode*
x-sts-autologin: true
x-sts-clienttime: 2021-02-15T12:18:03

返回的数据:

enter image description here

https://stackoverflow.com/a/66165935/196210

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)