curl2req
把浏览器请求转换为 requests 请求的工具
用法
1 打开浏览器F12,右键 Copy -> Copy as cURL (bash)
2 把请求保存到文件,例如 .curl
3 运行命令
from curl2req import curl_to_req
curl_to_req('./.curl', "", ".res", output_file_prefix="samples-res-")
4 查看结果 vim .res/samples-res-xxx.json
5 查看 json 结构
from curl2req import get_json_paths
keys = get_json_paths(host, show=False)
for k in keys:
k2 = k.replace('[]', '[0]')
print(k, json_get_data(host, k2)[0])
上传
pip install build
rm -rf dist/* && python -m build
twine upload dist/*
pip install -e .
Metadata
Release files for curl2req 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| curl2req-0.1.8.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| curl2req-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.8 kB
Release files / curl2req-0.1.8.tar.gz
| Download URL | curl2req-0.1.8.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f38b8231539af75a379ef6edc0d05c6f71b5e264240e808a6ebd2401b0fb4fe1
|
|
BLAKE2b-256 checksum How to use checksums |
86b469848603949ce0eb961eceb39b7c38128dcec3a8c77708e29672f70574a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.9
|
Release files / curl2req-0.1.8-py3-none-any.whl
| Download URL | curl2req-0.1.8-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a87fbe47b24fcd5b11e2b0a9eefc9616989dfa3a80b08bea3df89a60d1e000ae
|
|
BLAKE2b-256 checksum How to use checksums |
a3319728618547e6db6f2299dfb35b3d8d7368fba72895cf01e402565c1a508b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.9
|