cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
lala
Level VIII

如何用脚本下载这个网站的查询结果?

这个是其他语言的代码、要如何修改才能工作?谢谢大家!

Sub West()
    Dim result, antistop, Values As Variant, i, j, x, y, cnt
    Dim Json As Object
    cnt = Range("b1") & ""
    antistop = "{""question"":""ROE>20"",""perpage"":" & cnt & ",""page"":9,""secondary_intent"":""stock"",""log_info"":""{\""input_type\"":\""click\""}"",""source"":""Ths_iwencai_Xuangu"",""version"":""2.0"",""query_area"":"""",""block_list"":"""",""add_info"":""{\""urp\"":{\""scene\"":1,\""company\"":1,\""business\"":1},\""contentType\"":\""json\"",\""searchInfo\"":true}""}"
    With CreateObject("WinHttp.WinHttpRequest.5.1")
        .Open "Post", "http://x.10jqka.com.cn/customized/chart/get-robot-data", False
        .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
        .setRequestHeader "Content-Type", "application/json"
        .send antistop
        result = Split(Split(.responsetext, """datas"":")(1), ",""meta")(0)
        Set Json = JsonConverter.ParseJson(result)
      
    
End Sub
4 REPLIES 4
lala
Level VIII

回复: 如何用脚本下载这个网站的查询结果?

  • The above is VBA code, how to modify in JSL execution?Thanks!

jthi
Super User

回复: 如何用脚本下载这个网站的查询结果?

Check out New HTTP Request in Scripting Index (and most likely Guide) with JSON enabled:

jthi_0-1642154397274.png

 

-Jarmo
lala
Level VIII

回复: 如何用脚本下载这个网站的查询结果?

感谢!

通过多次的运用、这个脚本指南的这种方法我已经基本掌握了。

 

但这个网站不能用这种方法实现。

我按截图中的方式得到数据的网址、但不起作用

http://ai.iwencai.com/urp/v7/landing/getDataList

2022-01-14_212922.png

lala
Level VIII

回复: 如何用脚本下载这个网站的查询结果?

{
    "data":"query=ROE%3E20&urp_sort_way=desc&urp_sort_index=%E5%87%80%E8%B5%84%E4%BA%A7%E6%94%B6%E7%9B%8A%E7%8E%87roe%28%E5%8A%A0%E6%9D%83%2C%E5%85%AC%E5%B8%83%E5%80%BC%29%5B20210930%5D&page=1&perpage=100&condition=%5B%7B%22indexName%22%3A%22%E5%87%80%E8%B5%84%E4%BA%A7%E6%94%B6%E7%9B%8A%E7%8E%87roe%28%E5%8A%A0%E6%9D%83%2C%E5%85%AC%E5%B8%83%E5%80%BC%29%22%2C%22indexProperties%22%3A%5B%22nodate%201%22%2C%22%E4%BA%A4%E6%98%93%E6%97%A5%E6%9C%9F%2020210930%22%2C%22%280.2%22%5D%2C%22source%22%3A%22new_parser%22%2C%22type%22%3A%22index%22%2C%22indexPropertiesMap%22%3A%7B%22%E4%BA%A4%E6%98%93%E6%97%A5%E6%9C%9F%22%3A%2220210930%22%2C%22%28%22%3A%220.2%22%2C%22nodate%22%3A%221%22%7D%2C%22reportType%22%3A%22QUARTER%22%2C%22dateType%22%3A%22%E6%8A%A5%E5%91%8A%E6%9C%9F%22%2C%22chunkedResult%22%3A%22roe%3E20%22%2C%22valueType%22%3A%22_%E6%B5%AE%E7%82%B9%E5%9E%8B%E6%95%B0%E5%80%BC%28%25%29%22%2C%22domain%22%3A%22abs_%E8%82%A1%E7%A5%A8%E9%A2%86%E5%9F%9F%22%2C%22uiText%22%3A%22%E5%87%80%E8%B5%84%E4%BA%A7%E6%94%B6%E7%9B%8A%E7%8E%87roe%28%E5%8A%A0%E6%9D%83%2C%E5%85%AC%E5%B8%83%E5%80%BC%29%3E20%25%22%2C%22sonSize%22%3A0%2C%22queryText%22%3A%22%E5%87%80%E8%B5%84%E4%BA%A7%E6%94%B6%E7%9B%8A%E7%8E%87roe%28%E5%8A%A0%E6%9D%83%2C%E5%85%AC%E5%B8%83%E5%80%BC%29%3E20%25%22%2C%22relatedSize%22%3A0%2C%22tag%22%3A%22%E5%87%80%E8%B5%84%E4%BA%A7%E6%94%B6%E7%9B%8A%E7%8E%87roe%28%E5%8A%A0%E6%9D%83%2C%E5%85%AC%E5%B8%83%E5%80%BC%29%22%7D%5D&codelist=&indexnamelimit=&logid=d1ebf57fb412af7ed78f80207695161f&ret=json_all&sessionid=d1ebf57fb412af7ed78f80207695161f&date_range%5B0%5D=20210930&iwc_token=0ac9529a16421667775453095&urp_use_sort=1&user_id=Ths_iwencai_Xuangu_s1xg1peju6l4ycle36dqpr7iq2hs3qba&uuids%5B0%5D=24087&query_type=stock&comp_id=5897333&business_cat=soniu&uuid=24087",
    "method":"POST",
    "url":"http://ai.iwencai.com/urp/v7/landing/getDataList",
    "headers":{
        "Accept":" application/json, text/plain, */*",
        "Accept-Encoding":" gzip, deflate",
        "Accept-Language":" zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7",
        "Cache-control":" no-cache",
        "Connection":" keep-alive",
        "Content-Type":" application/x-www-form-urlencoded",
        "Cookie":" cid=bc9cfac7db41839ef3881b8dcb6d35731638928875; v=A3JRfcl9R2yuh3tQFvJLttzSw7NZA3TUqAJqwjxKnCoSFRhnJJPGrXiXusMP",
        "Origin":" http://www.iwencai.com",
        "Pragma":" no-cache",
        "Referer":" http://www.iwencai.com/unifiedwap/result?w=ROE%3E20&querytype=stock",
        "User-Agent":" Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
    }
}