【发布时间】:2020-05-29 00:37:57
【问题描述】:
我正在尝试将 json 数据从以下位置下载到 df 表中:“http://emweb.securities.eastmoney.com/NewFinanceAnalysis/lrbAjax?companyType=4&reportDateType=0&reportType=1&endDate=&code=SZ002475” ,即本页底部表格“http://emweb.securities.eastmoney.com/NewFinanceAnalysis/Index?type=web&code=SZ002475#”的原始数据
json 页面看起来是简单的 json 数据,如"[{\"SECURITYCODE\":\"002475.SZ\",\"REPORTTYPE\":\"1\",\"TYPE\":\" 4\",\"REPORTDATE\":\"2019/9/30 0:00:00\",\"TOTALOPERATEREVE\":\"37836138416.35\",\"OPERATEREVE\":\"37836138416.35\",. .......”
但是,以下代码没有返回任何内容:
url ="http://emweb.securities.eastmoney.com/NewFinanceAnalysis/lrbAjax?companyType=4&reportDateType=0&reportType=1&endDate=&code=SZ002475"
df = pd.read_json(url)
print(df)
【问题讨论】:
标签: python html json pandas dataframe