分页: 1 / 1

Python 采集抓取网页必备,Curl转python在线工具

帖子发表于 :周五 9月 10, 2021 11:01 am
adm1n
Curl转python在线工具
我只是工具的搬运工
https://curl.trillworks.com/
复制到了我自己网站一份,
备用链接1
备用链接2
可以将curl命令转为python代码块
如:
curl --request POST --url https://open.workec.com/auth/accesstoken --header 'cache-control: no-cache' --header 'content-type: application/json' --data '{ "appId": appId, "appSecret": "appSecret"}'
转化结果:
import requests
headers = {
'cache-control': 'no-cache',
'content-type': 'application/json',
}
data = '{\t"appId": appId,\t"appSecret": "appSecret"}'
response = requests.post('https://open.workec.com/auth/accesstoken', headers=headers, data=data)
github:https://github.com/NickCarneiro/curlconverter