Skip to content

Commit 4bf9e72

Browse files
author
shengyuhong
committed
fix: resolve #1892 by retriving the data page by page
1 parent c9d7c58 commit 4bf9e72

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

scripts/data_collector/utils.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -203,21 +203,11 @@ def _get_symbol():
203203
{600000.ss, 600001.ss, 600002.ss, 600003.ss, ...}
204204
"""
205205
# url = "http://99.push2.eastmoney.com/api/qt/clist/get?pn=1&pz=10000&po=1&np=1&fs=m:0+t:6,m:0+t:80,m:1+t:2,m:1+t:23,m:0+t:81+s:2048&fields=f12"
206-
# try:
207-
# resp = requests.get(url, timeout=None)
208-
# resp.raise_for_status()
209-
# except requests.exceptions.HTTPError as e:
210-
# raise requests.exceptions.HTTPError(f"Request to {url} failed with status code {resp.status_code}") from e
211-
212-
# try:
213-
# _symbols = [_v["f12"] for _v in resp.json()["data"]["diff"]]
214-
# except Exception as e:
215-
# logger.warning("An error occurred while extracting data from the response.")
216-
# raise
217206

218207
base_url = "http://99.push2.eastmoney.com/api/qt/clist/get"
219208
params = {
220-
"pz": 80, # 每页返回200条数据
209+
"pn": 1, # page number
210+
"pz": 100, # page size, default to 100
221211
"po": 1,
222212
"np": 1,
223213
"fs": "m:0+t:6,m:0+t:80,m:1+t:2,m:1+t:23,m:0+t:81+s:2048",

0 commit comments

Comments
 (0)