简体   繁体   English

是否可以使用请求从 chrome 工具 > 网络 > 预览中获取数据?

[英]Is it possible to get data from chrome tools > network > preview using requests?

I've written a short script and I have a chance to improve it if I get access to the certain data presented on screen.我写了一个简短的脚本,如果我可以访问屏幕上显示的某些数据,我就有机会改进它。 Is it possible somehow to requests this data with requests library?是否可以通过请求库以某种方式请求这些数据? I need to get a user with a particular id which I gather with my 2nd script.我需要使用我的第二个脚本收集的具有特定 ID 的用户。 I just need to know if it is possible because I could not find any answer on that.我只需要知道这是否可能,因为我找不到任何答案。

在此处输入图像描述

This is the code.这是代码。 Link comes from headers tab:链接来自标题选项卡:

import requests

url = "https://www.thecrims.com/api/v1/nightclub"    
payload = {"id":"17713682"}

r = requests.post(url, params=payload)

解决方法很简单,试试这个:

print(r.json())

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python 请求标头不起作用 - 检查 Chrome 开发者工具 -> 网络 - Python requests header not working - Checked Chrome developer tools -> Network 如何使用 python 在 chrome 开发人员工具中访问网络选项卡 - How to access network tab in chrome developer tools using python 如何使用浏览器开发人员工具从 POST 方法获取数据 - How to get data from POST method using browser developer tools 使用请求从 python 中的 curl 中的 API 获取数据 - using requests to get data from API from curl in python 有没有办法通过 Python 加载网页的网络活动(您可以在 Chrome Dev Tools 上看到)? - Is there a way to get a webpage's Network activity (which you can see on Chrome Dev Tools) on load via Python? 无法使用 Python 中的请求从站点获取数据 - Can't get data from site using requests in Python 如何使用 BeautifulSoup 和请求从网站获取数据? - How can I get data from a website using BeautifulSoup and requests? 从 URL 请求中获取数据 - Get data from URL requests Python Selenium:使用 execute_cdp_cmd() 捕获 Chrome 开发工具网络请求/响应日志 - Python Selenium : Capture Chrome Dev Tools Network Request/Response Logs using execute_cdp_cmd() 使用 Python 中的请求解析从 requests.get() 收到的数据时遇到问题 - Having trouble parsing the data recieved from requests.get() using requests in Python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM