-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
token的获取 #1
Comments
手机验证码不太好处理 |
@uname-yang ,匿名用户好像也可以拿到 token 和访问股票数据 API import requests
r = requests.get("https://xueqiu.com", headers={"user-agent":"Mozilla"})
print(r.cookies["xq_a_token"]) 这样就可以了,该 token 能拿到股票日线数据,别的 API 我没测试。 而且其实我发现,不管什么 UA 和什么 ip,只要未登录(也就是运行上面的代码),拿到的这个 token 似乎是一样的。。。 测试 demo: import requests
r = requests.get("https://xueqiu.com", headers={"user-agent":"Mozilla"})
t = r.cookies["xq_a_token"]
data = requests.get("https://stock.xueqiu.com/v5/stock/chart/kline.json\
?symbol=SH600000&begin=1583552766531&period=day&type=before&count=-142", cookies={"xq_a_token": t}, headers={"user-agent":"Mozilla/5.0"})
print(data.json()) |
有几个api 是不用加token就能访问的,大部分还是需要加的。这个token只要不超限速被过期,正常的过期时间是一个月。 |
雪球又升级了, 现在是先给一个acw_tc,然后拿acw_tc 和 acw_sc__v2 换一个token.
|
获取token的时候,能不能考虑用程序去自动获取;
The text was updated successfully, but these errors were encountered: