requests 完全兼容的反检测爬虫库,基于 Camoufox 反检测浏览器
Project description
sliprequests
requests 完全兼容的反检测爬虫库
基于 Camoufox 反检测浏览器,一行代码从 requests 迁移到高级反检测爬虫。
为什么用 sliprequests?
# 之前用 requests(会遇到人机验证)
import requests
resp = requests.get("https://example.com") # ❌ 被 Cloudflare 拦截
# 现在用 sliprequests(自动绕过反爬)
import sliprequests as requests
resp = requests.get("https://example.com") # ✅ 正常获取
零学习成本 — API 和 requests 完全一样,改一行 import 就行。
安装
pip install sliprequests
快速开始
import sliprequests as requests
# GET 请求
resp = requests.get("https://httpbin.org/ip")
print(resp.json())
# POST 请求
resp = requests.post("https://httpbin.org/post", json={"name": "test"})
# 带参数
resp = requests.get("https://httpbin.org/get", params={"q": "test"})
# Session
with requests.Session() as s:
s.get("https://example.com/login")
resp = s.get("https://example.com/dashboard")
代理支持
import sliprequests as requests
# Session 级别代理
with requests.Session() as s:
s.proxies = {
"http": "socks5://user:pass@host:port",
"https": "socks5://user:pass@host:port",
}
resp = s.get("https://example.com")
支持的参数
所有 requests 参数完全兼容:
| 参数 | 说明 |
|---|---|
params |
URL 查询参数 |
data |
POST 表单数据 |
json |
JSON 数据 |
headers |
请求头 |
cookies |
Cookies |
auth |
认证 |
timeout |
超时 |
proxies |
代理 |
verify |
SSL 验证 |
cert |
客户端证书 |
allow_redirects |
重定向 |
stream |
流式响应 |
反爬测试
| 网站 | 反爬系统 | 结果 |
|---|---|---|
| Cloudflare | Cloudflare Bot Management | ✅ |
| eBay | PerimeterX | ✅ |
| Twitter/X | 自研反爬 | ✅ |
| 自研反爬 | ✅ | |
| Airbnb | 多层反爬 | ✅ |
系统要求
- Python >= 3.8
- Camoufox Browser Server 运行在
localhost:9377
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sliprequests-0.2.0.tar.gz
(10.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sliprequests-0.2.0.tar.gz.
File metadata
- Download URL: sliprequests-0.2.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c568bdea0ab2d935024b197a9d05b54c2b5cfd16a504ae68c22788192c68e9e
|
|
| MD5 |
3c1293651f143e4b4116363cb2d52427
|
|
| BLAKE2b-256 |
be3d482e76b16e51a09e1c5ba80efb089661146551ba1649f7498bb0a28cf4db
|
File details
Details for the file sliprequests-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sliprequests-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7dd36ea47ef57cd6a173619976116331c9e784b5f11fee4867f0c4a130e43358
|
|
| MD5 |
3e6f685dcef49bd079272cd31c332e47
|
|
| BLAKE2b-256 |
5c8de55207c6b7cc4e672109893b823bd80bc6280045a71ede45825eea7ee60d
|