Skip to content

Commit

Permalink
Merge pull request #224 from lonelam/fix/cnindex
Browse files Browse the repository at this point in the history
fix: update domain for index data updates
  • Loading branch information
foolcage authored Nov 6, 2024
2 parents 63195d4 + 3f90065 commit 4280dd4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/zvt/recorders/exchange/api/cn_index_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/zvt/recorders/exchange/api/cn_index_stock_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 4280dd4

Please sign in to comment.