请教如何构建以下网页的请求! 有偿!

Power Pivot vinci lau ⋅ 于 2020-05-01 13:35:59 ⋅ 最后回复由 deadzlq 2020-05-02 10:54:25 ⋅ 2177 阅读

请哪位老师指点下如何构建下面这个页面的请求, 我是个新手, 还请包涵

http://www.sse.com.cn/assortment/stock/areatrade/area/detail.shtml?AREANAME=2

我写的代码如下:

let
    url = "http://query.sse.com.cn/commonQuery.do?&jsonCallBack=jsonpCallback97061&isPagination=false&sqlId=COMMON_SSE_GP_SJTJ_DQHYFL_ADQFL_MX_L&areaname=2&_=1588303208749",
    headers = [Cookie = yfx_c_g_u_id_10000042=_ck20032318483317775311077916017; VISITED_COMPANY_CODE=%5B%22601118%22%2C%22600968%22%5D; VISITED_STOCK_CODE=%5B%22601118%22%2C%22600968%22%5D; VISITED_MENU=%5B%228466%22%2C%228536%22%2C%228537%22%2C%228535%22%2C%229055%22%5D; yfx_f_l_v_t_10000042=f_t_1584960513687__r_t_1588301561018__v_t_1588303208041__r_c_1]
    referer = http://www.sse.com.cn/assortment/stock/areatrade/area/detail.shtml?AREANAME=2,
    wodata = Web.Contents(url, [Headers = headers, Referer=referer]),
    result = Json.Document(Text.BetweenDelimiters(
                                Text.FromBinary(
                                    wodata,0
                                ),
                                "(",")"
                          ))
in
    result

可以提供小小的报酬给能帮忙解决问题的老师!

成为第一个点赞的人吧 :bowtie:
回复数量: 1
  • deadzlq 无我,亦无期
    2020-05-02 10:54:25

    PQ参考M Code

    let
        url = "http://query.sse.com.cn/commonQuery.do?&jsonCallBack=jsonpCallback97061&isPagination=false&sqlId=COMMON_SSE_GP_SJTJ_DQHYFL_ADQFL_MX_L&areaname=2&_=1588303208749",
        referer = "http://www.sse.com.cn/assortment/stock/areatrade/area/detail.shtml?AREANAME=2",
        headers = [#"Accept-Language"="zh-CN,zh;q=0.9",Referer=referer,Cookie = "yfx_c_g_u_id_10000042=_ck20032318483317775311077916017; VISITED_COMPANY_CODE=%5B%22601118%22%2C%22600968%22%5D; VISITED_STOCK_CODE=%5B%22601118%22%2C%22600968%22%5D; VISITED_MENU=%5B%228466%22%2C%228536%22%2C%228537%22%2C%228535%22%2C%229055%22%5D; yfx_f_l_v_t_10000042=f_t_1584960513687__r_t_1588301561018__v_t_1588303208041__r_c_1"],
        wodata = Web.Contents(url, [Headers = headers]),
        result = Table.FromRecords(Json.Document("["&Text.BetweenDelimiters(Text.FromBinary(wodata),"(",")")&"]"){0}[result])
    in
        result
暂无评论~~
  • 请务必阅读并严格遵守《社区管理规范与使用说明》
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`, 更多语法请见这里 Markdown 语法
  • 支持表情,使用方法请见 发送表情,可用的 Emoji 见 :metal: :point_right: Emoji 列表 :star: :sparkles:
  • 上传图片, 支持拖拽和剪切板粘贴上传, 格式限制 - jpg, png, gif
  • 不支持上传附件,请尽可能用文字和图片将问题描述清楚,如实在需要上传附件,可上传到 共享网盘 后分享链接
  • 发布框支持本地存储功能,会在内容变更时保存,「提交」按钮点击时清空
  请勿发布不友善或者负能量的内容。与人为善,比聪明更重要!
Ctrl+Enter