Skip to main content

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 自研反爬
LinkedIn 自研反爬
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.1.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sliprequests-0.1.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file sliprequests-0.1.0.tar.gz.

File metadata

  • Download URL: sliprequests-0.1.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for sliprequests-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1381bb9c980b93a7f9cd8a2b747898a1fb5e40c9c8d41f89fa7b2544597b00fc
MD5 44272ca9de38d138edd5447f8f683bde
BLAKE2b-256 20e1b05f5b210170a529ef4e278b88715c08b93b9639b624184255ad9d666376

See more details on using hashes here.

File details

Details for the file sliprequests-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sliprequests-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for sliprequests-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3aa4e8e8a6ccfded6e5c5705ad9322ddf59a53c6a96144c3c8ba709be918d2e8
MD5 5f6f2cc60d089aa13fd3d15685a425e6
BLAKE2b-256 de7b7a5a18b34fe063867847ab18433fb70020682f2cfb5b1ad34337cce2df41

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page