Skip to content

今日和总访问量

SPIDER TOOLBOX

在线开发工具箱

为爬虫与日常开发准备的轻量工具,所有处理均在浏览器本地完成。

cURL 转 Python Requests

粘贴浏览器中复制的 cURL 命令,即时生成可运行的 Python 请求代码。

本地转换
01cURL 命令
02Python Requests
import requests

url = 'https://httpbin.org/anything?page=1'
headers = {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    'X-Client': 'spider-tools',
}
json_data = {
    'keyword': 'Python 爬虫',
    'limit': 10,
}

response = requests.post(
    url,
    headers=headers,
    json=json_data,
)

print(response.status_code)
print(response.text)
支持 Header、Cookie、JSON、表单、Basic Auth、代理等常用参数

今日和总访问量
本站收录内容源自互联网,不对其网站内容或交易负责。 | 如有内容侵犯权益,请联系站长删除相关内容!