|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- // output
- let
- Source = Json.Document(
- Web.Contents(
- "https://stock.xueqiu.com/v5/stock/finance/cn/indicator.json?symbol=SH600019&type=Q4&is_detail=true&count=5×tamp=",
- [
- Headers=[
- Cookie="xq_a_token=1132205e8c57eb587b26526804cff9f3b6bf6799; xqat=1132205e8c57eb587b26526804cff9f3b6bf6799;
- xq_r_token=81b9c911ea3907729d8f8e9f60d9f5251227c551; xq_id_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.
- eyJ1aWQiOi0xLCJpc3MiOiJ1YyIsImV4cCI6MTYwOTEyMzA1NywiY3RtIjoxNjA3ODI0MDQwMzc2LCJjaWQiOiJkOWQwbjRBWnVwIn0.
- mfZxOe9GxjIZJeU__K02CXlHuzqC0auAb4w5Tm16W6-Yeb-71pUqxXcHin1pUN_2ow0IsHOx58VCq0-QzGVyQyL_kqatkOVpBV2rj3Dy
- ISDr2E7nzH33qUi0CsPNaQrY4ropVjuUQ6PxWyGPkWQ0Zy3A_qpmh0FzYa5opxXx6IG_8jcccr7e4MCipoXKdGDXio76tQyM9-RmHwaHJH-
- VhbGf5KRgDXreJXJ0ZQZ7o53mk5R1LwZXsihkqAMG-RcFcw_QwpEJ6JQxrTvxs_HfLxFOJxoJYPRNYJiNJlT1s3dYBsZ3pyyOrktbXbbxs
- O9ERkgQrMoT4bCyp3sOvhxgUQ; u=771607824079184; Hm_lvt_1db88642e346389874251b5a1eded6e3=1607824083;
- device_id=d2177603e44463b8d5865064d5a16948; Hm_lpvt_1db88642e346389874251b5a1eded6e3=1607824100",
- #"User-Agent"="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
- Chrome/72.0.3626.81 Safari/537.36 SE 2.X MetaSr 1.0",
- Referer="https://xueqiu.com/snowman/S/SH600019/detail"
- ]
- ]
- )
- )[data][list],
- sTbl = Table.FromRecords(Source),
- rmvCols = Table.RemoveColumns(sTbl,{"report_date", "ctime"}),
- trsp = Table.PromoteHeaders(Table.Transpose(Table.DemoteHeaders(rmvCols))),
- sort = Table.Sort(trsp, {each List.PositionOf(Record.FieldNames(FieldDic), [report_name]), 0}),
- trans = Table.TransformColumns(sort, {"report_name", each Record.Field(FieldDic, _)}, each _{0})
- in
- trans
- // FieldDic
- let
- Source = Text.FromBinary(Web.Contents("https://assets.imedao.com/ugc/js/vue-web-47f39502cb.js")),
- cnFieldsStr = Text.BetweenDelimiters(Source, "indicator1:{", "},indicator2:"),
- rec = Expression.Evaluate("[#"""&Text.Replace(Text.Replace(cnFieldsStr, ":", """="),",", ", #""")&"]"),
- oldfd_newfd_Lists = List.Transform(List.Select(Record.FieldNames(rec), (x)=>Text.Contains(x, "$")), each {_, Text.BeforeDelimiter(_, "$")}),
- dic = Record.RenameFields(rec, oldfd_newfd_Lists)
- in
- dic
复制代码 可以试一下我的这个
|
-
结果表
|