我需要使用python获取红色的URL,它每天都在变化,所以我不能直接将它硬编码到我的程序中,我唯一固定的URL是绿色的,获取参数,如令牌,qid,或回调更改,所以我不能直接请求它

有没有办法获得所有“网络”请求的列表?如果我可以得到它,那么我可以使用不变的部分来查找我需要的网址,或者直接链接到.JSON的方法也可以,我如何实现这一点呢?
编辑:我有这个固定的链接https://www.hkex.com.hk/Market-Data/Securities-Prices/Equities?sc_lang=en (绿色),需要这个链接https://www1.hkex.com.hk/hkexwidget/data/getequityfilter?lang=eng&token=evLtsLsBNAUVTPxtGqVeGwzK35ZFJ/ZUHtaMT29Z5aJ1PmQCIZMQ2aoTplY9Ozc3&sort=5&order=0&qid=1627532414377&callback=jQuery35109210633367295534_1627532407574&_=1627532407576 (红色)的问题是,红色链接每天都会改变,以及它的GET参数,所以我需要使用绿色链接提取它,我已经尝试使用requests和urllib3获取超文本标记语言,但超文本标记语言既没有新的GET参数的信息,也没有.JSON中包含的信息
EDIT2:我对这部分没有问题,但是这里我不能硬编码这个红色的网址
url='https://www1.hkex.com.hk/hkexwidget/data/getequityfilter?lang=eng&token=evLtsLsBNAUVTPxtGqVeG9L82ZzJ20aOxX0Y6tf3oVlc%2f2L6sWNlm1qsCGs3dLts&sort=5&order=0&qid=1627389214442&callback=jQuery351020345220954587373_1627389204429&_=1627389204431'
response = requests.get(url)
data = json.loads(response.text)
data = data['data']
...print...发布于 2021-07-29 14:30:25
这个问题分为两个部分:
时,它都会崩溃
证券交易所
- Reading the data with a subscription will be much easier; there will be a documented API, possibly example code, tech support.- Without a subscription, they may be quite annoyed at you trying to scrape the information and take active steps to stop you (technical or potentially legal).https://stackoverflow.com/questions/68569968
复制相似问题