From 3f90065c7cb9cf79902f7577292a25d3288d731f Mon Sep 17 00:00:00 2001 From: laizn Date: Sun, 3 Nov 2024 00:37:52 +0800 Subject: [PATCH] fix: update domain for index data updates --- src/zvt/recorders/exchange/api/cn_index_api.py | 4 ++-- src/zvt/recorders/exchange/api/cn_index_stock_api.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zvt/recorders/exchange/api/cn_index_api.py b/src/zvt/recorders/exchange/api/cn_index_api.py index 46b4eb33..0d1262ca 100644 --- a/src/zvt/recorders/exchange/api/cn_index_api.py +++ b/src/zvt/recorders/exchange/api/cn_index_api.py @@ -12,7 +12,7 @@ logger = logging.getLogger(__name__) original_page_url = "http://www.cnindex.com.cn/zh_indices/sese/index.html?act_menu=1&index_type=-1" -url = "http://www.cnindex.net.cn/index/indexList?channelCode={}&rows=1000&pageNum=1" +url = "http://www.cnindex.com.cn/index/indexList?channelCode={}&rows=1000&pageNum=1" # 中证指数 抓取 风格指数 行业指数 规模指数 基金指数 cni_category_map_url = { @@ -80,7 +80,7 @@ def get_cn_index(index_type="cni", category=IndexCategory.style): for i, result in enumerate(results): logger.info(f"to {i}/{len(results)}") code = result["indexcode"] - info_resp = requests_session.get(f"http://www.cnindex.net.cn/index-intro?indexcode={code}") + info_resp = requests_session.get(f"http://www.cnindex.com.cn/index-intro?indexcode={code}") # fbrq: "2010-01-04" # jd: 1000 # jr: "2002-12-31" diff --git a/src/zvt/recorders/exchange/api/cn_index_stock_api.py b/src/zvt/recorders/exchange/api/cn_index_stock_api.py index 9ea8a79f..14278c36 100644 --- a/src/zvt/recorders/exchange/api/cn_index_stock_api.py +++ b/src/zvt/recorders/exchange/api/cn_index_stock_api.py @@ -11,7 +11,7 @@ logger = logging.getLogger(__name__) original_page_url = "http://www.cnindex.com.cn/module/index-detail.html?act_menu=1&indexCode=399001" -url = "http://www.cnindex.net.cn/sample-detail/detail?indexcode={}&dateStr={}&pageNum=1&rows=5000" +url = "http://www.cnindex.com.cn/sample-detail/detail?indexcode={}&dateStr={}&pageNum=1&rows=5000" def _get_resp_data(resp: requests.Response):