playwright-stealth-ultimate 5.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- playwright_stealth_ultimate-5.0.0/CHANGELOG.md +23 -0
- playwright_stealth_ultimate-5.0.0/LICENSE +21 -0
- playwright_stealth_ultimate-5.0.0/MANIFEST.in +30 -0
- playwright_stealth_ultimate-5.0.0/PKG-INFO +425 -0
- playwright_stealth_ultimate-5.0.0/README.md +379 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/__init__.py +46 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/config/capabilities/chromium/136.json +19 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/config/capabilities/chromium/137.json +20 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/config/capabilities/chromium/138.json +21 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/config/capabilities/chromium/139.json +22 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/config/policies/balanced.yaml +19 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/config/policies/performance.yaml +22 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/config/policies/strict.yaml +19 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/config/profiles/macos_ventura_chrome_139.yaml +38 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/config/profiles/windows_10_chrome_138.yaml +38 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/config/profiles/windows_11_chrome_139.yaml +38 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/audio.js +348 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/canvas.js +333 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/chrome.app.js +226 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/chrome.csi.js +194 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/chrome.hairline.js +138 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/chrome.load.times.js +330 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/chrome.runtime.js +698 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/concurrency.js +272 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/errors.js +321 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/evasions.proxies.js +278 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/fonts.js +497 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/generate.magic.arrays.js +317 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/iframe.contentWindow.js +318 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/intl.js +455 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/media.codecs.js +283 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/navigator.deviceMemory.js +290 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/navigator.hardware.js +362 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/navigator.hardwareConcurrency.js +133 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/navigator.languages.js +174 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/navigator.maxTouchPoints.js +387 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/navigator.permissions.js +240 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/navigator.platform.js +179 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/navigator.plugins.js +245 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/navigator.userAgent.js +218 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/navigator.vendor.js +158 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/navigator.webdriver.js +332 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/screen.js +386 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/utils.js +567 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/webgl.anisotropy.js +230 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/webgl.js +549 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/webgl.vendor.js +243 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/webrtc.js +514 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/window.outerdimensions.js +173 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/js/window.properties.js +242 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth/version.py +16 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth_ultimate.egg-info/PKG-INFO +425 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth_ultimate.egg-info/SOURCES.txt +105 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth_ultimate.egg-info/dependency_links.txt +1 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth_ultimate.egg-info/entry_points.txt +2 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth_ultimate.egg-info/not-zip-safe +1 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth_ultimate.egg-info/requires.txt +19 -0
- playwright_stealth_ultimate-5.0.0/playwright_stealth_ultimate.egg-info/top_level.txt +1 -0
- playwright_stealth_ultimate-5.0.0/pyproject.toml +96 -0
- playwright_stealth_ultimate-5.0.0/setup.cfg +4 -0
- playwright_stealth_ultimate-5.0.0/setup.py +88 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [5.0.0] - 2026-07-20
|
|
4
|
+
|
|
5
|
+
### Ajouté
|
|
6
|
+
- 🎉 Première version publique
|
|
7
|
+
- 🛡️ Évasions complètes pour Playwright et Selenium
|
|
8
|
+
- 📊 Benchmarking intégré
|
|
9
|
+
- 🧪 Suite de tests complète (75 tests)
|
|
10
|
+
- 📝 Documentation complète
|
|
11
|
+
|
|
12
|
+
### Fonctionnalités
|
|
13
|
+
- Masquage de `navigator.webdriver`
|
|
14
|
+
- Simulation de `chrome.runtime`
|
|
15
|
+
- Fingerprinting Canvas / Audio / WebGL
|
|
16
|
+
- Simulation de plugins et MIME types
|
|
17
|
+
- Support multi-plateformes
|
|
18
|
+
- Profils matériels réalistes
|
|
19
|
+
|
|
20
|
+
### Compatibilité
|
|
21
|
+
- Python 3.10+
|
|
22
|
+
- Playwright 1.40+
|
|
23
|
+
- Selenium 4.0+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Playwright Stealth Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# MANIFEST.in
|
|
2
|
+
# Inclusion des fichiers dans le package
|
|
3
|
+
|
|
4
|
+
# Documentation
|
|
5
|
+
include README.md
|
|
6
|
+
include LICENSE
|
|
7
|
+
include CHANGELOG.md
|
|
8
|
+
|
|
9
|
+
# Configuration
|
|
10
|
+
include pyproject.toml
|
|
11
|
+
include setup.py
|
|
12
|
+
|
|
13
|
+
# Scripts JS (évasion)
|
|
14
|
+
recursive-include playwright_stealth/js *.js
|
|
15
|
+
|
|
16
|
+
# Configuration YAML/JSON
|
|
17
|
+
recursive-include playwright_stealth/config *.yaml *.json
|
|
18
|
+
|
|
19
|
+
# Fichiers de typage
|
|
20
|
+
include playwright_stealth/py.typed
|
|
21
|
+
|
|
22
|
+
# Exclure les fichiers inutiles
|
|
23
|
+
exclude .gitignore
|
|
24
|
+
exclude .pre-commit-config.yaml
|
|
25
|
+
exclude .ruff.toml
|
|
26
|
+
prune tests
|
|
27
|
+
prune examples
|
|
28
|
+
prune benchmark_reports
|
|
29
|
+
prune docs
|
|
30
|
+
prune .github
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: playwright-stealth-ultimate
|
|
3
|
+
Version: 5.0.0
|
|
4
|
+
Summary: Framework d'évasion anti-bot pour Playwright et Selenium
|
|
5
|
+
Home-page: https://github.com/yourusername/playwright-stealth-ultimate
|
|
6
|
+
Author: Jeff
|
|
7
|
+
Author-email: Jeff <jeffx@live.fr>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/jeffx/playwright-stealth-ultimate
|
|
10
|
+
Project-URL: Bug Reports, https://github.com/jeffx/playwright-stealth-ultimate/issues
|
|
11
|
+
Project-URL: Source, https://github.com/jeffx/playwright-stealth-ultimate
|
|
12
|
+
Keywords: playwright,selenium,stealth,anti-bot,scraping
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: playwright>=1.40.0
|
|
27
|
+
Requires-Dist: cachetools>=5.0.0
|
|
28
|
+
Requires-Dist: pyyaml>=6.0
|
|
29
|
+
Provides-Extra: selenium
|
|
30
|
+
Requires-Dist: selenium>=4.0.0; extra == "selenium"
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: pytest>=9.0.0; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest-cov>=7.0.0; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-xdist>=3.0.0; extra == "dev"
|
|
35
|
+
Requires-Dist: black>=24.0.0; extra == "dev"
|
|
36
|
+
Requires-Dist: ruff>=0.5.0; extra == "dev"
|
|
37
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
38
|
+
Requires-Dist: psutil>=7.0.0; extra == "dev"
|
|
39
|
+
Provides-Extra: docs
|
|
40
|
+
Requires-Dist: mkdocs>=1.5.0; extra == "docs"
|
|
41
|
+
Requires-Dist: mkdocs-material>=9.5.0; extra == "docs"
|
|
42
|
+
Dynamic: author
|
|
43
|
+
Dynamic: home-page
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
Dynamic: requires-python
|
|
46
|
+
|
|
47
|
+
# 📄 FICHIER : `README.md`
|
|
48
|
+
|
|
49
|
+
```markdown
|
|
50
|
+
# 🛡️ Playwright Stealth
|
|
51
|
+
|
|
52
|
+
**Framework d'évasion anti-bot pour Playwright et Selenium**
|
|
53
|
+
|
|
54
|
+
[](https://www.python.org/downloads/)
|
|
55
|
+
[](https://playwright.dev/python/)
|
|
56
|
+
[](LICENSE)
|
|
57
|
+
[](tests/)
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 📋 Table des matières
|
|
62
|
+
|
|
63
|
+
- [🛡️ Playwright Stealth](#-playwright-stealth)
|
|
64
|
+
- [📋 Table des matières](#-table-des-matières)
|
|
65
|
+
- [📖 Présentation](#-présentation)
|
|
66
|
+
- [✨ Fonctionnalités](#-fonctionnalités)
|
|
67
|
+
- [📦 Installation](#-installation)
|
|
68
|
+
- [🚀 Quick Start](#-quick-start)
|
|
69
|
+
- [🎯 Utilisation avancée](#-utilisation-avancée)
|
|
70
|
+
- [Profil personnalisé](#profil-personnalisé)
|
|
71
|
+
- [Modules d'évasion personnalisés](#modules-dévasion-personnalisés)
|
|
72
|
+
- [Configuration complète](#configuration-complète)
|
|
73
|
+
- [Scraping multi-pages](#scraping-multi-pages)
|
|
74
|
+
- [🔧 API](#-api)
|
|
75
|
+
- [🧪 Tests](#-tests)
|
|
76
|
+
- [📊 Benchmarks](#-benchmarks)
|
|
77
|
+
- [🤝 Contribution](#-contribution)
|
|
78
|
+
- [📝 License](#-license)
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 📖 Présentation
|
|
83
|
+
|
|
84
|
+
**Playwright Stealth** est un framework Python conçu pour éviter la détection par les systèmes anti-bot (Cloudflare, DataDome, Akamai, etc.) lors de l'automatisation de navigateurs avec **Playwright** ou **Selenium**.
|
|
85
|
+
|
|
86
|
+
Le framework modifie les APIs natives du navigateur pour masquer les signaux d'automatisation les plus courants :
|
|
87
|
+
|
|
88
|
+
- `navigator.webdriver`
|
|
89
|
+
- `window.chrome.runtime`
|
|
90
|
+
- Fingerprinting Canvas / Audio / WebGL
|
|
91
|
+
- Plugins et MIME types
|
|
92
|
+
- Dimensions de l'écran
|
|
93
|
+
- Polices système
|
|
94
|
+
- WebRTC / Géolocalisation
|
|
95
|
+
- Et bien plus...
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## ✨ Fonctionnalités
|
|
100
|
+
|
|
101
|
+
| Catégorie | Évasions |
|
|
102
|
+
|-----------|----------|
|
|
103
|
+
| **Navigateur** | `navigator.webdriver`, `navigator.plugins`, `navigator.mimeTypes` |
|
|
104
|
+
| **Chrome** | `window.chrome.runtime`, `window.chrome.app`, `window.chrome.csi` |
|
|
105
|
+
| **Fingerprinting** | Canvas, AudioContext, WebGL, Fonts |
|
|
106
|
+
| **Réseau** | WebRTC, IP locale, Permissions |
|
|
107
|
+
| **Matériel** | `navigator.hardwareConcurrency`, `navigator.deviceMemory` |
|
|
108
|
+
| **OS** | `navigator.platform`, `navigator.userAgent`, `navigator.languages` |
|
|
109
|
+
| **Affichage** | `window.outerWidth`, `window.outerHeight`, `screen` |
|
|
110
|
+
| **Comportement** | Mouvement de souris, frappe clavier, scrolling |
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 📦 Installation
|
|
115
|
+
|
|
116
|
+
### Prérequis
|
|
117
|
+
|
|
118
|
+
- Python 3.10 ou supérieur
|
|
119
|
+
- Playwright ou Selenium
|
|
120
|
+
|
|
121
|
+
### Installation standard
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Installer le package
|
|
125
|
+
pip install playwright-stealth
|
|
126
|
+
|
|
127
|
+
# Installer les navigateurs Playwright
|
|
128
|
+
playwright install
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Installation pour le développement
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Cloner le dépôt
|
|
135
|
+
git clone https://github.com/yourusername/playwright-stealth.git
|
|
136
|
+
cd playwright-stealth
|
|
137
|
+
|
|
138
|
+
# Installer en mode editable
|
|
139
|
+
pip install -e .[dev]
|
|
140
|
+
|
|
141
|
+
# Installer les navigateurs
|
|
142
|
+
playwright install
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 🚀 Quick Start
|
|
148
|
+
|
|
149
|
+
### Exemple basique avec Playwright
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
from playwright.sync_api import sync_playwright
|
|
153
|
+
from playwright_stealth import stealth_sync
|
|
154
|
+
|
|
155
|
+
with sync_playwright() as p:
|
|
156
|
+
browser = p.chromium.launch(headless=False)
|
|
157
|
+
page = browser.new_page()
|
|
158
|
+
|
|
159
|
+
# ✅ Une seule ligne pour activer le stealth
|
|
160
|
+
stealth_sync(page)
|
|
161
|
+
|
|
162
|
+
# Naviguer vers un site
|
|
163
|
+
page.goto("https://example.com")
|
|
164
|
+
|
|
165
|
+
# Vérifier que le stealth est actif
|
|
166
|
+
result = page.evaluate("() => navigator.webdriver")
|
|
167
|
+
print(f"webdriver: {result}") # ✅ undefined
|
|
168
|
+
|
|
169
|
+
browser.close()
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Exemple avec Selenium
|
|
173
|
+
|
|
174
|
+
```python
|
|
175
|
+
from selenium import webdriver
|
|
176
|
+
from playwright_stealth.adapters.selenium import stealth_selenium
|
|
177
|
+
|
|
178
|
+
driver = webdriver.Chrome()
|
|
179
|
+
|
|
180
|
+
# ✅ Activer le stealth
|
|
181
|
+
stealth_selenium(driver)
|
|
182
|
+
|
|
183
|
+
driver.get("https://example.com")
|
|
184
|
+
print(driver.execute_script("return navigator.webdriver")) # ✅ undefined
|
|
185
|
+
|
|
186
|
+
driver.quit()
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## 🎯 Utilisation avancée
|
|
192
|
+
|
|
193
|
+
### Profil personnalisé
|
|
194
|
+
|
|
195
|
+
```python
|
|
196
|
+
from playwright.sync_api import sync_playwright
|
|
197
|
+
from playwright_stealth import stealth_sync
|
|
198
|
+
from playwright_stealth.core.types import HardwareTier, OSType, BrowserVendor
|
|
199
|
+
|
|
200
|
+
with sync_playwright() as p:
|
|
201
|
+
browser = p.chromium.launch()
|
|
202
|
+
page = browser.new_page()
|
|
203
|
+
|
|
204
|
+
# ✅ Profil personnalisé (MacBook Pro)
|
|
205
|
+
stealth_sync(
|
|
206
|
+
page,
|
|
207
|
+
hardware_tier=HardwareTier.PREMIUM,
|
|
208
|
+
os_type=OSType.MACOS,
|
|
209
|
+
browser_vendor=BrowserVendor.CHROME,
|
|
210
|
+
custom_seed="a1b2c3d4e5f67890" # Seed pour la reproductibilité
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
page.goto("https://example.com")
|
|
214
|
+
browser.close()
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Modules d'évasion personnalisés
|
|
218
|
+
|
|
219
|
+
```python
|
|
220
|
+
from playwright.sync_api import sync_playwright
|
|
221
|
+
from playwright_stealth.core.engine import FingerprintEngine
|
|
222
|
+
from playwright_stealth.core.types import EvasionModule
|
|
223
|
+
|
|
224
|
+
class CustomHeaderModule:
|
|
225
|
+
"""Module personnalisé pour ajouter des headers HTTP"""
|
|
226
|
+
name = "custom_header"
|
|
227
|
+
priority = 10
|
|
228
|
+
dependencies = ()
|
|
229
|
+
conflicts = ()
|
|
230
|
+
|
|
231
|
+
def build(self, profile, loader):
|
|
232
|
+
return """
|
|
233
|
+
(function() {
|
|
234
|
+
const originalFetch = window.fetch;
|
|
235
|
+
window.fetch = function(url, options) {
|
|
236
|
+
options = options || {};
|
|
237
|
+
options.headers = options.headers || {};
|
|
238
|
+
options.headers['X-Custom-Header'] = 'Stealth-Module';
|
|
239
|
+
return originalFetch.call(this, url, options);
|
|
240
|
+
};
|
|
241
|
+
console.log('🛡️ Custom header module activé');
|
|
242
|
+
})();
|
|
243
|
+
"""
|
|
244
|
+
|
|
245
|
+
def validate(self, profile):
|
|
246
|
+
return []
|
|
247
|
+
|
|
248
|
+
# Utilisation
|
|
249
|
+
with sync_playwright() as p:
|
|
250
|
+
browser = p.chromium.launch()
|
|
251
|
+
page = browser.new_page()
|
|
252
|
+
|
|
253
|
+
# Créer l'engine avec le module personnalisé
|
|
254
|
+
from playwright_stealth.core.profile import FingerprintProfile
|
|
255
|
+
from playwright_stealth.services.builder import BuilderService
|
|
256
|
+
from playwright_stealth.services.injector import InjectorService
|
|
257
|
+
# ... (services)
|
|
258
|
+
|
|
259
|
+
# Injecter
|
|
260
|
+
engine.inject(page, enabled_modules=["custom_header"])
|
|
261
|
+
page.goto("https://example.com")
|
|
262
|
+
browser.close()
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Configuration complète
|
|
266
|
+
|
|
267
|
+
```python
|
|
268
|
+
from playwright_stealth import FullConfig, PlaywrightStealthClient
|
|
269
|
+
|
|
270
|
+
# ✅ Configuration complète
|
|
271
|
+
config = FullConfig(
|
|
272
|
+
hardware_tier=HardwareTier.HIGH,
|
|
273
|
+
os_type=OSType.WINDOWS,
|
|
274
|
+
browser_vendor=BrowserVendor.CHROME,
|
|
275
|
+
enabled_modules=["webdriver", "canvas", "audio", "intl"],
|
|
276
|
+
consistency="strict",
|
|
277
|
+
performance="balanced",
|
|
278
|
+
cache_size=2000,
|
|
279
|
+
telemetry_enabled=True,
|
|
280
|
+
debug=True
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
client = PlaywrightStealthClient(config)
|
|
284
|
+
client.initialize()
|
|
285
|
+
|
|
286
|
+
# Appliquer à une page
|
|
287
|
+
client.apply_to_page(page)
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Scraping multi-pages
|
|
291
|
+
|
|
292
|
+
```python
|
|
293
|
+
from playwright_stealth import MultiPageScraper, PageConfig
|
|
294
|
+
|
|
295
|
+
# ✅ Configuration des pages
|
|
296
|
+
pages = [
|
|
297
|
+
PageConfig(
|
|
298
|
+
url="https://example.com",
|
|
299
|
+
name="Example",
|
|
300
|
+
selectors={"title": "h1", "description": "p"}
|
|
301
|
+
),
|
|
302
|
+
PageConfig(
|
|
303
|
+
url="https://www.wikipedia.org",
|
|
304
|
+
name="Wikipedia",
|
|
305
|
+
selectors={"title": "h1", "links": "a"}
|
|
306
|
+
)
|
|
307
|
+
]
|
|
308
|
+
|
|
309
|
+
# ✅ Scraper
|
|
310
|
+
scraper = MultiPageScraper()
|
|
311
|
+
results = scraper.scrape_pages(pages, rotate_profiles=True)
|
|
312
|
+
scraper.export_results()
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## 🔧 API
|
|
318
|
+
|
|
319
|
+
### Fonctions principales
|
|
320
|
+
|
|
321
|
+
| Fonction | Description |
|
|
322
|
+
|----------|-------------|
|
|
323
|
+
| `stealth_sync(page, ...)` | Applique le stealth à une page Playwright (sync) |
|
|
324
|
+
| `stealth_async(page, ...)` | Applique le stealth à une page Playwright (async) |
|
|
325
|
+
| `stealth_selenium(driver, ...)` | Applique le stealth à un driver Selenium |
|
|
326
|
+
| `dump_configuration()` | Affiche la configuration actuelle |
|
|
327
|
+
|
|
328
|
+
### Types disponibles
|
|
329
|
+
|
|
330
|
+
| Type | Description |
|
|
331
|
+
|------|-------------|
|
|
332
|
+
| `HardwareTier` | LOW, MEDIUM, HIGH, PREMIUM |
|
|
333
|
+
| `OSType` | WINDOWS, MACOS, LINUX |
|
|
334
|
+
| `BrowserVendor` | CHROME, EDGE, BRAVE, OPERA |
|
|
335
|
+
| `FingerprintProfile` | Profil complet d'empreinte |
|
|
336
|
+
| `EvasionModule` | Interface pour les modules d'évasion |
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## 🧪 Tests
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
# Exécuter tous les tests
|
|
344
|
+
python run_all_tests.py
|
|
345
|
+
|
|
346
|
+
# Tests unitaires uniquement
|
|
347
|
+
pytest tests/unit/ -v
|
|
348
|
+
|
|
349
|
+
# Tests d'intégration Playwright
|
|
350
|
+
pytest tests/integration/test_injection.py -v -m playwright
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## 📊 Benchmarks
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
# Benchmarks rapides (20 itérations)
|
|
359
|
+
python examples/advanced/benchmark_runner.py -i 20 -w 3
|
|
360
|
+
|
|
361
|
+
# Benchmarks complets (50 itérations)
|
|
362
|
+
python examples/advanced/benchmark_runner.py -i 50 -w 5
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Résultats typiques
|
|
366
|
+
|
|
367
|
+
| Benchmark | Mean (ms) | P95 (ms) |
|
|
368
|
+
|-----------|-----------|----------|
|
|
369
|
+
| Profile Generation | < 0.10 | < 0.50 |
|
|
370
|
+
| Plan Building (1 module) | < 0.02 | < 0.10 |
|
|
371
|
+
| Plan Building (5 modules) | < 0.02 | < 0.10 |
|
|
372
|
+
| Injection Playwright | < 100 | < 200 |
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## 🤝 Contribution
|
|
377
|
+
|
|
378
|
+
Les contributions sont les bienvenues !
|
|
379
|
+
|
|
380
|
+
1. **Fork** le projet
|
|
381
|
+
2. **Créer** une branche (`git checkout -b feature/amazing`)
|
|
382
|
+
3. **Commit** (`git commit -m 'Add amazing feature'`)
|
|
383
|
+
4. **Push** (`git push origin feature/amazing`)
|
|
384
|
+
5. **Ouvrir** une Pull Request
|
|
385
|
+
|
|
386
|
+
### Guidelines
|
|
387
|
+
|
|
388
|
+
- ✅ Ajouter des tests pour les nouvelles fonctionnalités
|
|
389
|
+
- ✅ Mettre à jour la documentation
|
|
390
|
+
- ✅ Suivre le style PEP 8
|
|
391
|
+
- ✅ Utiliser des types hints
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## 📝 License
|
|
396
|
+
|
|
397
|
+
MIT © Playwright Stealth Team
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## ⭐ Support
|
|
402
|
+
|
|
403
|
+
Si ce projet vous est utile, n'oubliez pas de mettre une ⭐ sur GitHub !
|
|
404
|
+
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
**Fait avec ❤️ par l'équipe Playwright Stealth**
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## 📋 RÉSUMÉ
|
|
413
|
+
|
|
414
|
+
| # | Section | Statut |
|
|
415
|
+
|---|---------|--------|
|
|
416
|
+
| 1 | Présentation | ✅ |
|
|
417
|
+
| 2 | Fonctionnalités | ✅ |
|
|
418
|
+
| 3 | Installation | ✅ |
|
|
419
|
+
| 4 | Quick Start | ✅ |
|
|
420
|
+
| 5 | Utilisation avancée | ✅ |
|
|
421
|
+
| 6 | API | ✅ |
|
|
422
|
+
| 7 | Tests | ✅ |
|
|
423
|
+
| 8 | Benchmarks | ✅ |
|
|
424
|
+
| 9 | Contribution | ✅ |
|
|
425
|
+
| 10 | License | ✅ |
|