我想提取的网页为:http://data.eastmoney.com/zlsj/jj.html[url=],[/url]
按照EXCELHOME上建立查询,具体方法见;https://www.yunfa.vip/thread-8668-1-1.html?_dsign=30ac9a14
let
源 =Web.Page(Web.Contents("http://data.eastmoney.com/zlsj/jj.html")),
Data0 = 源{0}[Data],
更改的类型 =Table.TransformColumnTypes(Data0,{{"序号",Int64.Type}, {"股票代码", Int64.Type}, {"股票简称", typetext}, {"相关链接", type text}, {"持有基金家数(家)",Int64.Type}, {"持股总数(万股)", type number}, {"持股市值(亿元)",type number}, {"持股变化", type text}, {"持股变动数值(万股)",type number}, {"持股变动比例(%)", type number}, {"持仓变动", typetext}, {"持仓明细", type text}})
in
更改的类型
修改后的M:
(page as number) as table=>
let
源 =Web.Page(Web.Contents("http://data.eastmoney.com/zlsj/jj"&Number.ToText(page) &".html")),
Data0 = 源{0}[Data],
更改的类型 =Table.TransformColumnTypes(Data0,{{"序号",Int64.Type}, {"股票代码", Int64.Type}, {"股票简称", typetext}, {"相关链接", type text}, {"持有基金家数(家)",Int64.Type}, {"持股总数(万股)", type number}, {"持股市值(亿元)",type number}, {"持股变化", type text}, {"持股变动数值(万股)",type number}, {"持股变动比例(%)", type number}, {"持仓变动", typetext}, {"持仓明细", type text}})
in
更改的类型
出现错误:
实地址为: 我用httpwatch抓到地址为:
http://data.eastmoney.com/zlsj/zlsj_list.aspx?type=ajax&st=2&sr=-1&p=1&ps=50&jsObj=iXlaJkGY&stat=1&cmd=1&date=2017-12-31&rt=50711400
修改后的M:
(page as number) as table=>
let
源 =Web.Page(Web.Contents("http://data.eastmoney.com/zlsj/jj"&Number.ToText(page) &".html")),
Data0 = 源{0}[Data],
更改的类型 =Table.TransformColumnTypes(Data0,{{"序号",Int64.Type}, {"股票代码", Int64.Type}, {"股票简称", typetext}, {"相关链接", type text}, {"持有基金家数(家)",Int64.Type}, {"持股总数(万股)", type number}, {"持股市值(亿元)",type number}, {"持股变化", type text}, {"持股变动数值(万股)",type number}, {"持股变动比例(%)", type number}, {"持仓变动", typetext}, {"持仓明细", type text}})
in
更改的类型
EXCELHOME 有答疑:
你可以用抓包工具查看一下真实的连接地址,然后用函数进行转换
请教在这里如何转换
|