Files
MoFin/archive/20260722-scripts-cleanup/test_single.py
T

8 lines
358 B
Python

import urllib.request,json,time
r = urllib.request.Request(
"https://push2.eastmoney.com/api/qt/stock/get?secid=116.00700&fields=f43,f170&fltt=2",
headers={"User-Agent": "Mozilla/5.0"})
start = time.time()
resp = json.loads(urllib.request.urlopen(r, timeout=5).read())
print(f"OK {time.time()-start:.1f}s price={resp.get('data',{}).get('f43','?')}")