-X、-H、--data 等参数解析。复杂情况可手动调整。
在爬虫开发过程中,从浏览器控制台抓取请求参数是一个高频动作。本工具能够将复制的 cURL 命令 瞬间解析并自动生成符合 feapder 框架(AirSpider/Spider/BatchSpider)规范的 Python 代码,大幅缩减手动构建 Request 对象的时间。
requests 或 scrapy 请求逻辑快速适配到 feapder 框架中。本站工具深度适配了 feapder 的 feapder.Request 参数规范:
-H 参数转换为 Python 字典,并自动剔除不必要的伪头部(如 :authority)。--data, --data-raw, --data-binary 等负载模式,并将其解析为对应的 data(表单)或 json 参数。yield feapder.Request(...) 模板,包含 url, method, headers, params 或 body。callback=self.parse 等 feapder 标准回调函数占位符。原始 cURL:
curl 'https://api.example.com/data' -H 'User-Agent: Mozilla/5.0' -H 'Content-Type: application/json' --data-raw '{"id":123}'
生成的 feapder 代码 (本站处理):
yield feapder.Request(
url="https://api.example.com/data",
method="POST",
headers={
"User-Agent": "Mozilla/5.0",
"Content-Type": "application/json"
},
json={"id": 123},
callback=self.parse
)