leek-fund icon indicating copy to clipboard operation
leek-fund copied to clipboard

请求新浪链接已经403

Open qq516249940 opened this issue 2 years ago • 6 comments

请求新浪链接已经403 https://hq.sinajs.cn/list=hk00700 请问还有请求地址吗,还有是如何更换地址。 image

qq516249940 avatar Nov 10 '22 02:11 qq516249940

development.md 文档

giscafer avatar Nov 10 '22 03:11 giscafer

#165

giscafer avatar Nov 10 '22 03:11 giscafer

公司网墙了?

James-chok avatar Nov 10 '22 08:11 James-chok

这个地址我也访问不了,待观察

giscafer avatar Nov 10 '22 16:11 giscafer

In [13]: import requests

In [14]: headers={'Referer' :'https://finance.sina.com.cn'} ...: url='https://hq.sinajs.cn/list=sh600000' ...: file=requests.get(url=url,headers=headers) ...: print(file.text) var hq_str_sh600000="浦发银行,6.830,6.780,6.940,6.980,6.830,6.940,6.950,40237053,277525770.000,71208,6.940,278600,6.930,136200,6.920,133700,6.910,261400,6.900,283009,6.950,781217,6.960,817835,6.970,902872,6.980,1002106,6.990,2022-11-11,15:00:00,00,"; image

我使用python3 添加Referer可以访问了, Referer 是一个常见字段,提供访问来源的信息。 来源:https://www.jisilu.cn/question/449813 请各位大佬参考一下。

qq516249940 avatar Nov 12 '22 16:11 qq516249940

666

ghost avatar Feb 16 '23 03:02 ghost