[已解决] 请教EXCEL POWERQUERY 提取多页网页,网址如何转换

  [复制链接]
查看118033 | 回复123 | 2020-9-16 05:00:02 | 显示全部楼层 |阅读模式
我想提取的网页为: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 有答疑:

你可以用抓包工具查看一下真实的连接地址,然后用函数进行转换

请教在这里如何转换













回复

使用道具 举报

hxx | 2020-9-16 05:07:02 | 显示全部楼层
json格式数据。用Json.Document()函数处理。。
回复

使用道具 举报

jylt2004 | 2020-9-16 05:12:03 | 显示全部楼层
回复

使用道具 举报

风云1号 | 2020-9-16 05:19:03 | 显示全部楼层
在C盘根目录下,有一个文件夹,1,他里面有约200个htm文件,名字是1,2,3,4,,,,10,11,,,,100,101,,,199,200.附件里有两个文件,作示例,
想用vba的办法或power query的办法把这些htm中的表2,也就是最大的那张表。全部进到一个excel文件里来。但是没有办,请教。
9839012005491.rar (53.69 KB, 下载次数: 0)
回复

使用道具 举报

volcano | 2021-7-2 08:11:21 来自手机 | 显示全部楼层
支持楼主,用户楼主,楼主英明呀!!!
回复

使用道具 举报

huangbo88 | 2021-7-31 19:22:18 来自手机 | 显示全部楼层
越办越好,经常过来学习视频~~~~~~~~~
回复

使用道具 举报

quike111 | 2021-8-7 14:24:28 来自手机 | 显示全部楼层
感謝云发教育!!!
回复

使用道具 举报

zl8850038 | 2021-8-18 18:17:17 | 显示全部楼层
有空大家一起交流一下
回复

使用道具 举报

sxp | 2021-8-25 06:14:19 来自手机 | 显示全部楼层
不错 支持下
回复

使用道具 举报

叶哥哥 | 2021-9-2 12:08:35 | 显示全部楼层
谢谢网站确实不错,超值
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则