def get_zh_stock_ah_page_count() -> int: hk_payload_copy = hk_payload.copy() hk_payload_copy.update({"reqPage": 1}) res = requests.get(hk_url, params=hk_payload_copy, headers=hk_headers) data_json = demjson.decode(res.text[res.text.find("{"): res.text.rfind("}") + 1]) page_count = data_json["data"]["page_count"] return page_count
def _get_zh_stock_ah_page_count() -> int: """ 腾讯财经-港股-AH-总页数 https://stockapp.finance.qq.com/mstats/#mod=list&id=hk_ah&module=HK&type=AH&sort=3&page=3&max=20 :return: 总页数 :rtype: int """ hk_payload_copy = hk_payload.copy() hk_payload_copy.update({"reqPage": 1}) res = requests.get(hk_url, params=hk_payload_copy, headers=hk_headers) data_json = demjson.decode(res.text[res.text.find("{"): res.text.rfind("}") + 1]) page_count = data_json["data"]["page_count"] return page_count