Skip to content

Commit acebac2

Browse files
All use English uniformly
1 parent 2405c57 commit acebac2

File tree

3 files changed

+3
-365
lines changed

3 files changed

+3
-365
lines changed

README.md

Lines changed: 1 addition & 347 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,7 @@
1313
<a href="https://deepwiki.com/autoscrape-labs/pydoll"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
1414
</p>
1515

16-
<p align="center">
17-
<!-- Language Switch | 语言切换 -->
18-
<strong>🌍 Language:</strong>
19-
<a href="#english">English</a> •
20-
<a href="#中文">中文</a>
21-
</p>
16+
2217

2318
<p align="center">
2419
<a href="https://autoscrape-labs.github.io/pydoll/">Documentation</a> •
@@ -32,8 +27,6 @@
3227

3328
---
3429

35-
<div id="english">
36-
3730
## Key Features
3831

3932
🎭 **Advanced Browser Fingerprint Spoofing** - Revolutionary one-click fingerprint protection system
@@ -518,346 +511,7 @@ Every bit of support makes a difference — thank you!
518511

519512
Pydoll is licensed under the [MIT License](LICENSE).
520513

521-
</div>
522-
523-
---
524-
525-
<div id="中文">
526-
527-
## 主要特性
528-
529-
🎭 **先进的浏览器指纹伪装** - 革命性的一键指纹保护系统
530-
🔹 **零WebDriver依赖!** 告别WebDriver兼容性噩梦
531-
🔹 **原生验证码绕过!** 平滑处理Cloudflare Turnstile和reCAPTCHA v3*
532-
🔹 **异步性能** 实现闪电般快速的自动化
533-
🔹 **类人交互** 模拟真实用户行为
534-
🔹 **强大的事件系统** 用于响应式自动化
535-
🔹 **多浏览器支持** 包括Chrome和Edge
536-
537-
## 为什么存在Pydoll
538-
539-
想象一下:您需要自动化浏览器任务。也许是测试您的Web应用程序、从网站抓取数据或自动化重复流程。传统上,这意味着要处理外部驱动程序、复杂配置以及看似无处不在的兼容性问题。
540-
541-
但还有一个更大的挑战:**现代Web保护系统**。浏览器指纹识别技术、Cloudflare Turnstile验证码、reCAPTCHA v3以及能够立即识别和阻止传统自动化工具的复杂机器人检测算法。您精心编写的自动化脚本失败不是因为错误,而是因为网站可以跟踪您独特的浏览器指纹并识别出这不是人类。
542-
543-
**Pydoll就是为改变这种情况而生的。**
544-
545-
Pydoll采用不同的理念从头构建,直接连接到Chrome DevTools协议(CDP),完全消除了对外部驱动程序的需求。更重要的是,它融合了先进的浏览器指纹伪装和智能验证码绕过功能,使您的自动化几乎无法与真实的人类交互区分开来。
546-
547-
## Pydoll的特别之处
548-
549-
- **🎭 革命性指纹伪装**:一键激活生成真实的随机化浏览器指纹,欺骗甚至复杂的跟踪系统。涵盖所有主要指纹技术,包括WebGL、Canvas、音频、Navigator属性等。
550-
551-
- **智能验证码绕过**:内置自动解决Cloudflare Turnstile和reCAPTCHA v3验证码,无需外部服务、API密钥或复杂配置。
552-
553-
- **真正的人类交互**:先进算法模拟真实的人类行为模式。
554-
555-
- **真正的简单性**:我们不希望您浪费时间配置驱动程序或处理兼容性问题。
556-
557-
- **原生异步性能**:从头开始使用`asyncio`构建。
558-
559-
- **强大的网络监控**:轻松拦截、修改和分析所有网络流量。
560-
561-
- **事件驱动架构**:实时响应页面事件、网络请求和用户交互。
562-
563-
- **直观的元素查找**:现代化的`find()``query()`方法。
564-
565-
- **强大的类型安全**:全面的类型系统,提供更好的IDE支持。
566-
567-
## 安装
568-
569-
### 从 PyPI 安装(标准版本)
570-
571-
```bash
572-
pip install pydoll-python
573-
```
574-
575-
### 从 GitHub 安装(增强版本,带指纹伪装功能)
576-
577-
对于带有先进浏览器指纹伪装功能的增强版本:
578-
579-
```bash
580-
# 安装最新的增强版本,带有指纹伪装功能
581-
pip install git+https://github.com/3-Tokisaki-Kurumi/pydoll-enhance.git
582-
583-
# 或安装特定版本/分支
584-
pip install git+https://github.com/3-Tokisaki-Kurumi/pydoll-enhance.git@main
585-
```
586-
587-
就这样。无需下载驱动程序,无需复杂配置。只需安装即可开始使用先进的保护绕过功能的自动化。
588-
589-
## 浏览器指纹伪装
590-
591-
### 概述
592-
593-
Pydoll的增强版本包含革命性的浏览器指纹伪装功能。此功能为网站用于跟踪和识别自动化脚本的浏览器指纹技术提供全面保护。
594-
595-
### 主要特性
596-
597-
- 🎭 **一键启用** - 用单个参数启用完整的指纹保护
598-
- 🔄 **智能生成** - 自动生成随机但真实的浏览器指纹
599-
- 🛡️ **全面防护** - 覆盖所有主要指纹向量
600-
- 💾 **指纹持久化** - 保存和重用指纹配置
601-
- ⚙️ **高度可定制** - 微调指纹特征
602-
- 🚀 **无缝集成** - 与现有代码透明地工作
603-
604-
### 指纹伪装快速开始
605-
606-
```python
607-
import asyncio
608-
from pydoll.fingerprint import Chrome
609-
610-
async def fingerprint_protected_automation():
611-
# 用一个参数启用指纹伪装
612-
async with Chrome(enable_fingerprint_spoofing=True) as browser:
613-
tab = await browser.start()
614-
615-
# 您的自动化以完全伪装的指纹运行
616-
await tab.go_to('https://fingerprintjs.github.io/fingerprintjs/')
617-
618-
# 检查生成的指纹
619-
summary = browser.get_fingerprint_summary()
620-
print("当前指纹:", summary)
621-
622-
asyncio.run(fingerprint_protected_automation())
623-
```
624-
625-
### 高级指纹配置
626-
627-
```python
628-
from pydoll.fingerprint import Chrome, FingerprintConfig
629-
630-
async def custom_fingerprint_automation():
631-
# 创建自定义指纹配置
632-
config = FingerprintConfig(
633-
browser_type="chrome",
634-
preferred_os="windows",
635-
min_screen_width=1920,
636-
max_screen_width=1920,
637-
min_screen_height=1080,
638-
max_screen_height=1080,
639-
enable_webgl_spoofing=True,
640-
enable_canvas_spoofing=True,
641-
enable_audio_spoofing=True,
642-
)
643-
644-
async with Chrome(
645-
enable_fingerprint_spoofing=True,
646-
fingerprint_config=config
647-
) as browser:
648-
tab = await browser.start()
649-
await tab.go_to('https://amiunique.org/fp')
650-
651-
asyncio.run(custom_fingerprint_automation())
652-
```
653-
654-
### 指纹保护技术
655-
656-
此增强版本伪装以下指纹技术:
657-
658-
#### 🔧 Navigator 属性
659-
- 具有真实浏览器版本的User-Agent字符串
660-
- 平台信息(Windows、macOS、Linux)
661-
- 语言设置和偏好
662-
- 硬件并发和设备内存
663-
- 浏览器插件及其详细信息
664-
665-
#### 🖥️ 屏幕和显示属性
666-
- 屏幕分辨率和可用尺寸
667-
- 颜色深度和像素密度
668-
- 窗口内部/外部尺寸
669-
- 设备像素比
670-
671-
#### 🎨 WebGL 指纹
672-
- WebGL供应商和渲染器信息
673-
- 支持的WebGL扩展
674-
- WebGL参数值
675-
- 显卡信息伪装
676-
677-
#### 🖼️ Canvas 指纹
678-
- Canvas渲染结果操作
679-
- 图像数据噪声注入
680-
- 文本渲染变化
681-
682-
#### 🔊 音频指纹
683-
- AudioContext采样率伪装
684-
- 音频处理特征
685-
- 声音合成变化
686-
687-
#### 🛡️ 反检测功能
688-
- 移除`navigator.webdriver`属性
689-
- 隐藏自动化相关对象
690-
- 伪装`toString`方法结果
691-
- 绕过常见检测脚本
692-
693-
### 测试您的指纹保护
694-
695-
访问这些网站验证您的指纹伪装是否工作:
696-
697-
1. **FingerprintJS演示**: https://fingerprintjs.github.io/fingerprintjs/
698-
2. **AmIUnique**: https://amiunique.org/fp
699-
3. **BrowserLeaks**: https://browserleaks.com/javascript
700-
701-
每个浏览器会话都应生成唯一、真实的指纹。
702-
703-
## 快速开始
704-
705-
### 您的第一个自动化
706-
707-
让我们从简单的开始。下面的代码打开浏览器,导航到网站并与元素交互:
708-
709-
```python
710-
import asyncio
711-
from pydoll.browser import Chrome
712-
713-
async def my_first_automation():
714-
# 创建浏览器实例
715-
async with Chrome() as browser:
716-
# 启动浏览器并获取标签页
717-
tab = await browser.start()
718-
719-
# 导航到网站
720-
await tab.go_to('https://example.com')
721-
722-
# 直观地查找元素
723-
button = await tab.find(tag_name='button', class_name='submit')
724-
await button.click()
725-
726-
# 或直接使用CSS选择器/XPath
727-
link = await tab.query('a[href*="contact"]')
728-
await link.click()
729-
730-
# 运行自动化
731-
asyncio.run(my_first_automation())
732-
```
733-
734-
### 自定义配置
735-
736-
有时您需要更多控制。Pydoll提供灵活的配置选项:
737-
738-
```python
739-
from pydoll.browser import Chrome
740-
from pydoll.browser.options import ChromiumOptions
741-
742-
async def custom_automation():
743-
# 配置浏览器选项
744-
options = ChromiumOptions()
745-
options.add_argument('--proxy-server=username:password@ip:port')
746-
options.add_argument('--window-size=1920,1080')
747-
options.add_argument('--disable-web-security')
748-
options.binary_location = '/path/to/your/browser'
749-
750-
async with Chrome(options=options) as browser:
751-
tab = await browser.start()
752-
753-
# 您的自动化代码在这里
754-
await tab.go_to('https://example.com')
755-
756-
# 浏览器现在使用您的自定义设置
757-
758-
asyncio.run(custom_automation())
759-
```
760-
761-
## 高级功能
762-
763-
### 智能验证码绕过
764-
765-
Pydoll最具革命性的功能之一是能够自动处理通常阻止自动化工具的现代验证码系统。这不仅仅是解决验证码 - 而是让您的自动化对保护系统完全透明。
766-
767-
**支持的验证码类型:**
768-
- **Cloudflare Turnstile** - reCAPTCHA的现代替代品
769-
- **reCAPTCHA v3** - Google的隐形验证码系统
770-
- **自定义实现** - 新验证码类型的可扩展框架
771-
772-
```python
773-
import asyncio
774-
from pydoll.browser import Chrome
775-
776-
async def advanced_captcha_bypass():
777-
async with Chrome() as browser:
778-
tab = await browser.start()
779-
780-
# 方法1:上下文管理器(等待验证码完成)
781-
async with tab.expect_and_bypass_cloudflare_captcha():
782-
await tab.go_to('https://site-with-cloudflare.com')
783-
print("Cloudflare Turnstile 自动解决!")
784-
785-
# 继续您的自动化 - 验证码已处理
786-
await tab.find(id='username').type_text('user@example.com')
787-
await tab.find(id='password').type_text('password123')
788-
await tab.find(tag_name='button', text='Login').click()
789-
790-
# 方法2:后台处理(非阻塞)
791-
await tab.enable_auto_solve_cloudflare_captcha()
792-
await tab.go_to('https://another-protected-site.com')
793-
# 验证码在后台自动解决,代码继续执行
794-
795-
# 方法3:特定实现的自定义验证码选择器
796-
await tab.enable_auto_solve_cloudflare_captcha(
797-
custom_selector=(By.CLASS_NAME, 'custom-captcha-widget'),
798-
time_before_click=3, # 解决前等待3秒
799-
time_to_wait_captcha=10 # 10秒后超时
800-
)
801-
802-
await tab.disable_auto_solve_cloudflare_captcha()
803-
804-
asyncio.run(advanced_captcha_bypass())
805-
```
806-
807-
**为什么这很重要:**
808-
- **无外部依赖**:无需验证码解决服务或API密钥
809-
- **成本效益**:消除月度验证码解决服务费用
810-
- **可靠**:无需依赖第三方可用性即可一致工作
811-
- **快速**:即时解决,无需到外部服务的网络延迟
812-
- **无缝集成**:验证码绕过在您的自动化流程中透明进行
813-
814-
### 高级元素查找
815-
816-
Pydoll提供多种直观的方式来查找元素。无论您喜欢如何工作,我们都有适合您的方法:
817-
818-
```python
819-
import asyncio
820-
from pydoll.browser import Chrome
821-
822-
async def element_finding_examples():
823-
async with Chrome() as browser:
824-
tab = await browser.start()
825-
await tab.go_to('https://example.com')
826-
827-
# 按属性查找(最直观)
828-
submit_btn = await tab.find(
829-
tag_name='button',
830-
class_name='btn-primary',
831-
text='Submit'
832-
)
833-
834-
# 按ID查找
835-
username_field = await tab.find(id='username')
836-
837-
# 查找多个元素
838-
all_links = await tab.find(tag_name='a', find_all=True)
839-
840-
# CSS选择器和XPath
841-
nav_menu = await tab.query('nav.main-menu')
842-
specific_item = await tab.query('//div[@data-testid="item-123"]')
843-
844-
# 带超时和错误处理
845-
delayed_element = await tab.find(
846-
class_name='dynamic-content',
847-
timeout=10,
848-
raise_exc=False # 如果未找到则返回None
849-
)
850-
851-
# 高级:自定义属性
852-
custom_element = await tab.find(
853-
data_testid='submit-button',
854-
aria_label='Submit form'
855-
)
856-
857-
asyncio.run(element_finding_examples())
858-
```
859514

860-
</div>
861515

862516
<p align="center">
863517
<b>Pydoll</b> — Making browser automation magical!

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ exclude = ['tests', 'tests/*']
5454
[tool.pytest.ini_options]
5555
pythonpath = "."
5656
addopts = '-p no:warnings'
57+
asyncio_mode = "auto"
58+
asyncio_default_fixture_loop_scope = "function"
5759

5860
[tool.taskipy.tasks]
5961
lint = 'ruff check .; ruff check . --diff'

tests/test.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)