|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
这代码没法普适,你选择的公司数量不同 代码的深化步骤就得改了。
- let
- 源 =
- let
- url = "https://mopsfin.twse.com.tw/compare/data",
- headers = [#"Content-Type" = "application/x-www-form-urlencoded; charset=UTF-8"],
- content
- = "compareItem=Revenue&quarter=true&ylabel=%E4%BB%9F%E5%85%83&ys=0&revenue=true&bcodeAvg=false&companyAvg=false&qnumber=&companyId=2330+%E5%8F%B0%E7%A9%8D%E9%9B%BB+(%E4%B8%8A%E5%B8%82%E5%8D%8A%E5%B0%8E%E9%AB%94%E6%A5%AD)",
- web = Text.FromBinary(
- Web.Contents(url, [Headers = headers, Content = Text.ToBinary(content)])
- )
- in
- Web.Page(web),
- Data = 源{0}[Data],
- Children = Data{0}[Children],
- Children1 = Json.Document(Children{1}[Children]{0}[Text]),
- 自定义1 =
- let
- a = Children1[xaxisList],
- b = Children1[graphData]{0}[data]
- in
- Table.FromColumns({a, List.Transform(b, each _{1})})
- in
- 自定义1
复制代码 |
|