正在尝试从此页“https://www.hkex.com.hk/Market-Data/Statistics/Consolidated-Reports/Monthly-Bulletin?sc_lang=en#select1=0&select2=28”提取表。通过chorme的inspect/network功能,数据请求链接为“https://www.hkex.com.hk/eng/stat/smstat/mthbull/rpt_turnover_short_selling_current_month_1910.json?_=1574650413485”。直接访问时,此链接看起来像json格式。但是,使用此链接的代码不起作用
我的代码:
import pandas as pd
url="https://www.hkex.com.hk/eng/stat/smstat/mthbull/rpt_turnover_short_selling_current_month_1910.json?_=1574650413485"
df = pd.read_json(url)
print(df.info(verbose=True))
print(df)
还尝试:
url="https://www.hkex.com.hk/eng/stat/smstat/mthbull/rpt_turnover_short_selling_current_month_1910.json?"
您可以尝试先下载json,然后将其转换回
DataFrame
相关问题 更多 >
编程相关推荐