【问题标题】:how could I get this URL from XHR我怎么能从 XHR 得到这个 URL
【发布时间】:2018-10-15 04:16:57
【问题描述】:

我想通过请求从这个 Page 获取这个 URL。

我要获取的网址:https://www.holonis.com/api/comments/5ae3cfc82eebca0025b9890c/post

【问题讨论】:

    标签: python python-3.x xmlhttprequest python-requests


    【解决方案1】:

    你可以通过requests.get获取请求:

    import json
    import requests
    
    ## Fetch the page
    resp = requests.get(url)
    
    ## Load it into a dict
    node = json.loads(resp.text)
    

    然后您可以从节点或其他信息中获取 cmets,如下所示:

    comments = [element['body'] for element in node['items']]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-01-06
      • 1970-01-01
      • 2018-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多