老师,我又在其他地方找到一个方法,解决动态网址中的问题 用这个方法应该就不用日后每天换更换网址获取数据了
- let
- Source = Json.Document(Web.Contents("https://www.jisilu.cn/data/cbnew/delisted/?")),
- rows = Table.Combine(Table.FromList(Source[rows],each {Table.FromRecords({Record.FieldValues(_){1}})},{"t"})[t]),
- 重命名的列 = Table.RenameColumns(rows,{{"bond_id", "转债代码"},{"bond_nm", "转债名称"},{"price", "最后交易价格"},{"stock_id", "正股代码"},{"stock_nm", "正股名称"},{"orig_iss_amt", "发行规模"},{"put_iss_amt", "回售规模"},{"curr_iss_amt", "剩余规模"},{"issue_dt", "发行日期"},{"redeem_dt", "最后交易日"},{"delist_dt", "到期日期"},{"maturity_dt", "计划到期日期"},{"listed_years", "存续年限"},{"delist_notes", "退市原因"}}),
- 更改的类型 = Table.TransformColumnTypes(重命名的列,{{"转债代码", type text}, {"转债名称", type text}, {"正股名称", type text}, {"正股代码", type text}, {"退市原因", type text}, {"最后交易价格", type number}, {"发行规模", type number}, {"回售规模", type number}, {"剩余规模", type number}, {"存续年限", type number}, {"发行日期", type date}, {"最后交易日", type date}, {"到期日期", type date}, {"计划到期日期", type date}})
- in
- 更改的类型
复制代码
|