
탐지되지 않는 버전의 Playwright 테스트 및 자동화 라이브러리입니다.
<h1 align="center">
🎭 Patchright
</h1>
<p align="center">
<a href="https://github.com/Kaliiiiiiiiii-Vinyzu/patchright/blob/main/LICENSE">
<img src="https://img.shields.io/badge/License-Apache%202.0-green">
</a>
<a>
<img src="https://img.shields.io/badge/Based%20on-Playwright-goldenrod">
</a>
<a>
<img src="https://img.shields.io/badge/Driver-Patched-blue">
</a>
<a href="https://github.com/Kaliiiiiiiiii-Vinyzu/patchright/releases/latest">
<img alt="Patchright Version" src="https://img.shields.io/github/v/release/Kaliiiiiiiiii-Vinyzu/patchright?display_name=release&label=Version">
</a>
<br/>
<a href="https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python">
<img src="https://img.shields.io/badge/Package-Python-seagreen">
</a>
<a href="https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python/releases">
<img alt="Python Downloads" src="https://img.shields.io/pepy/dt/patchright?color=red&label=Python%20Downloads">
</a>
<a href="https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-nodejs">
<img src="https://img.shields.io/badge/Package-NodeJS-seagreen">
</a>
<a href="https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-nodejs/releases">
<img alt="NodeJS Downloads" src="https://img.shields.io/npm/d18m/patchright?color=red&label=NodeJS%20Downloads">
</a>
<a href="https://github.com/DevEnterpriseSoftware/patchright-dotnet">
<img src="https://img.shields.io/badge/Package-.Net-seagreen">
</a>
<a href="https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-nodejs/releases">
<img alt=".Net Downloads" src="https://img.shields.io/nuget/dt/Patchright?label=.Net%20Downloads">
</a>
<br/>
<img src="https://img.shields.io/github/actions/workflow/status/Kaliiiiiiiiii-Vinyzu/patchright/patchright_tests.yml?label=Patchright%20Driver%20Tests">
<img src="https://img.shields.io/github/actions/workflow/status/Kaliiiiiiiiii-Vinyzu/patchright-python/patchright_tests.yml?label=Patchright%20Python%20Tests">
<img src="https://img.shields.io/github/actions/workflow/status/DevEnterpriseSoftware/patchright-dotnet/patchright_test.yml?label=Patchright%20.Net%20Tests">
</p>
#### Patchright는 Playwright 테스트 및 자동화 프레임워크의 패치된 탐지 불가 버전입니다. </br> Playwright의 드롭인 대체품으로 사용할 수 있습니다.
> [!NOTE]
> 이 저장소는 Patchright 드라이버를 제공합니다. Patchright를 사용하려면 [Python 패키지](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python), [NodeJS 패키지](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-nodejs) 또는 _커뮤니티 주도_ [.Net 패키지](https://github.com/DevEnterpriseSoftware/patchright-dotnet/)를 확인하세요.
> [!IMPORTANT]
> Patchright는 CHROMIUM 기반 브라우저만 패치합니다. Firefox와 Webkit은 지원되지 않습니다.
---
<details open id="sponsors">
<summary><h3>스폰서</h1></summary>
<sup>이 프로젝트를 후원하고 싶으신가요? Discord에서 [@vinyzu](https://discordapp.com/users/935224495126487150)에게 연락하세요!</sup>
[<img width="60%" alt="NodeMaven Banner" src="https://assets.kitploit.com/production/public/readmes/41476/8409e9fd4ecade7fa018f576c77d6f51fb342f311f9e8e2b49984de007b5a605/fc71d82e04f5dc303d21f905310e811885d8a6a57ddffe892b4164bf12547371-display-v1.webp" />](https://go.nodemaven.com/Vinyzuoctober)
</br>
#### [NodeMaven](https://go.nodemaven.com/Vinyzuoctober): 고품질 IP를 갖춘 웹 스크래핑 및 자동화를 위한 효율적인 프록시 제공업체입니다.
왜 [NodeMaven](https://go.nodemaven.com/Vinyzuoctober)인가요?
🎯 ZIP 타겟팅
</br>
✅ 99.9% 가동 시간
</br>
🔍 IP 필터링: 프록시는 사기 점수 <97%가 보장됩니다
</br>
🔰 KYC 불필요
</br>
🎉 독특한 무료 도구: 프록시 대역폭 검사기, 메타 태그 검사기, IP 조회 등!
Patchright 사용자를 위한 **특별 코드**:
</br>
🔥 **PATCHRIGHT35** - 모바일 및 주거용 프록시 **35% 할인**
</br>
🔥 **PATCHRIGHT40** - ISP(정적) 프록시 **40% 할인**
<sup>[NodeMaven](https://go.nodemaven.com/Vinyzuoctober)과 함께 품질과 안정성을 선택하세요.</sup>
</br>
<sup>더 많은 웹 스크래핑 및 자동화 솔루션은 Nodemaven의 새 GitHub에서 확인하세요 - https://github.com/nodemaven</sup>
---
[<img height="100" alt="swiftproxy banner" src="https://assets.kitploit.com/production/public/readmes/41476/71326e65aa66112fe5c3cd5a61951b775d58850b93eaaf166fd77930681f5174.png" />](https://www.swiftproxy.net/?ref=Vinyzu)
#### [Swiftproxy](https://www.swiftproxy.net/?ref=Vinyzu): 확장 가능한 데이터 수집을 위한 고성능 주거용 프록시
**안정적인** 안티 디텍션 프록시 인프라가 필요한 개발자를 위해 구축되었습니다. [Swiftproxy](https://www.swiftproxy.net/?ref=Vinyzu)는 **안정적인 연결**, **높은 성공률**, 그리고 **대규모 스크래핑 및 자동화**를 위한 유연한 제어를 제공합니다.
- 🌍 윤리적으로 소싱된 주거용 IP를 갖춘 195개 이상의 위치
- 🔄 정밀한 지역 타겟팅을 지원하는 **로테이팅** 및 **스티키 세션**
- ⚡ **안티 밴** 및 **높은 성공률**에 최적화
- 🔌 HTTP / HTTPS / SOCKS5 지원
- 🧪 테스트를 위한 **500MB 무료 체험**
- 💸 Patchright 사용자를 위한 **특별 할인** 코드: **PROXY90 - 10%**
<sup> 최적 용도: 웹 스크래핑, 자동화, 멀티 어카운팅, 대규모 데이터 추출 </sup>
---
[<img height="90" alt="rapidproxy banner" src="https://assets.kitploit.com/production/public/readmes/41476/2c138417cf7695cb48943327f3d6d9036986882c2a4ffe5e9172f07386a9f229.png" />](https://www.rapidproxy.io/?ref=Vinyzu)
#### [RapidProxy](https://www.rapidproxy.io/?ref=Vinyzu)는 대규모 데이터 운영을 위해 구축된 안정적이고 고성능인 프록시 네트워크를 제공합니다.
[RapidProxy](https://www.rapidproxy.io/?ref=Vinyzu) 제공 사항:
- 🌍 9천만 개 이상의 주거용 IP (200개 이상의 위치)
- 🔄 **로테이팅 주거용 프록시** — **$0.65/GB**부터 (만료되지 않는 트래픽)
- 🧩 **정적 주거용 IP** — **$5/IP** (30일, 무제한 트래픽)
- 🎯 정밀한 지역 타겟팅
- ⚡ **무료 체험 가능** — 위험 부담 없이 프록시 성능 테스트
- 스크래핑, 자동화, 고성능 데이터 워크플로를 위해 구축됨
- 🔥 특별 혜택: 코드 **RAPID10**을 사용하면 **10% 할인**
<sup> 빠르게 시작하세요. 전 세계적으로 확장하세요. [RapidProxy](https://www.rapidproxy.io/?ref=Vinyzu)와 함께 안정성을 유지하세요. </sup>
---
<div align="center">
<img src="https://assets.kitploit.com/production/public/readmes/41476/f3ac5dd3dd1ac541342eeda194f605fe1e28f9b044c0a90867b6db914c4a1b48/ad967b2ca510d337e9c8e72d654869c8fc75b08b088e358e074a6bbb003e6639-display-v1.webp" width="56" alt="Scrappey">
### [Scrappey](https://scrappey.com?utm_source=patchright&utm_medium=github&utm_campaign=repo_readme)의 후원
</div>
브라우저가 탐지를 통과하도록 하는 것은 하나의 문제입니다. 수백만 건의 요청에 걸쳐 프록시를 계속 로테이션하고, 핑거프린트를 최신 상태로 유지하며, 세션을 살아 있게 유지하는 것은 또 다른 문제입니다. **Scrappey**는 두 번째 문제를 해결합니다. 하나의 엔드포인트로, 해결된 페이지를 돌려받습니다.
- **Clearcote** — 자체적으로 패치한 Chromium으로, 기본 빌드가 아닌 사내에서 직접 유지 관리
- **하나의 엔드포인트 뒤의 여러 엔진** — 한 스택에서 차단되면 다른 스택으로 라우팅
- API를 통한 **클릭, 입력, 대기, 스크롤** — 단순 페치 프록시가 아닌 실제 세션
- **주거용 및 데이터센터 프록시** 포함, 또는 직접 가져오기
- **요청당 과금**, 월 최소 사용량 없음
```bash
curl -X POST "https://publisher.scrappey.com/api/v1?key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"cmd": "request.get", "url": "https://example.com"}'
```
코드 `PATCHRIGHT`로 10% 할인 받기
[문서](https://scrappey.com/docs?utm_source=patchright&utm_medium=github&utm_campaign=repo_readme) · [Discord](https://scrappey.com/discord?utm_source=patchright&utm_medium=github&utm_campaign=repo_readme) · [API 키 받기](https://scrappey.com?utm_source=patchright&utm_medium=github&utm_campaign=repo_readme)
---
[<img height="120" alt="ProxyLane Banner" src="https://assets.kitploit.com/production/public/readmes/41476/ed95563a028e0c1cefb4f5dccc8f7b69653f4c3fb7d5c4b5099b4cd5718714b7/7afb4fb03926a17d778280ff8bc7b2f62f5206d212d2b7525ea6ee90ae8ed0d3-display-v1.webp" />](https://proxylane.dev/?utm_source=patchright&utm_medium=partnership&utm_campaign=patchright_sponsor_202610&utm_content=readme)
</br>
#### [ProxyLane](https://proxylane.dev/?utm_source=patchright&utm_medium=partnership&utm_campaign=patchright_sponsor_202610&utm_content=readme): 각 Patchright 프로필의 일관성을 유지하는 주거용 프록시.
보고되는 시간대를 프록시와 일치시키려면, 각 프로필에 도시에 고정된 자체 고정 IP(sticky IP)를 부여하고 동일한 시간대를 설정하세요:
```py
context = playwright.chromium.launch_persistent_context(
user_data_dir="...", channel="chrome", headless=False, no_viewport=True,
proxy={"server": "http://us.gw.proxylane.dev:10000",
"username": "USER_c_US_city_Chicago_s_profile1", # one sticky IP per profile
"password": "PASS"},
timezone_id="America/Chicago", locale="en-US", # match the proxy city
)
```
<sup>팁: `--webrtc-ip-handling-policy=disable_non_proxied_udp`를 설정하세요. 그렇지 않으면 [WebRTC가 실제 IP를 노출합니다](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python/issues/47).</sup>
:earth_africa: 195개국, 도시, ZIP 및 ASN 타겟팅을 지원하는 2,800만 개의 주거용 IP
</br>
:stopwatch: 최대 72시간까지 유지되는 고정 세션, HTTP 및 SOCKS5
</br>
:money_with_wings: $2/GB부터, 트래픽은 만료되지 않음
:fire: **PATCHLANE35** - Patchright 사용자를 위한 **35% 할인**
<sup>스니펫을 붙여넣고 자격 증명을 추가한 뒤 [ProxyLane](https://proxylane.dev/?utm_source=patchright&utm_medium=partnership&utm_campaign=patchright_sponsor_202610&utm_content=readme_caption)과 함께 실제 주거용 IP에서 다음 Patchright 세션을 실행하세요.</sup>
</details>
---
## 패치
### [Runtime.enable](https://vanilla.aslushnikov.com/?Runtime.enable) 누출
이것은 Patchright가 사용하는 가장 큰 패치입니다. 이 누출로 인한 탐지를 피하기 위해 patchright는 (격리된) ExecutionContext에서 Javascript를 실행하여 [Runtime.enable](https://vanilla.aslushnikov.com/?Runtime.enable)을 사용하지 않습니다.
### [Console.enable](https://vanilla.aslushnikov.com/?Console.enable) 누출
Patchright는 Console API를 완전히 비활성화하여 이 누출을 패치합니다. 즉, Patchright에서는 콘솔 기능이 작동하지 않습니다. 콘솔이 정말로 필요하다면 Javascript 로거를 사용하는 것이 더 나을 수 있지만, 이 역시 쉽게 탐지될 수 있습니다.
### 명령 플래그 누출
Patchright는 명령 플래그 누출로 인한 탐지를 피하기 위해 Playwright 기본 인수를 조정합니다. 이는 (가장 중요하게) 다음에 영향을 미칩니다:
- `--disable-blink-features=AutomationControlled` (추가됨) - navigator.webdriver 탐지를 피하기 위해.
- `--enable-automation` (제거됨) - navigator.webdriver 탐지를 피하기 위해.
- `--disable-popup-blocking` (제거됨) - 팝업 충돌을 피하기 위해.
- `--disable-component-update` (제거됨) - 스텔스 드라이버로 탐지되는 것을 피하기 위해.
- `--disable-default-apps` (제거됨) - 기본 앱을 활성화하기 위해.
- `--disable-extensions` (제거됨) - 확장 기능을 활성화하기 위해
### 일반 누출
Patchright는 Playwright 코드베이스의 일부 일반적인 누출을 패치합니다. 여기에는 주로 잘못된 설정과 명백한 탐지 지점이 포함됩니다.
### 닫힌 Shadow Root
Patchright는 닫힌 Shadow Root 내의 요소와 상호작용할 수 있습니다. 일반 로케이터를 사용하기만 하면 Patchright가 나머지를 처리합니다.
<br/>
Patchright는 이제 닫힌 Shadow Root에서 XPath도 사용할 수 있습니다.
---
## 스텔스
올바른 설정을 갖추면 Patchright는 현재 탐지 불가능한 것으로 간주됩니다.
Patchright는 다음을 통과합니다:
- [Brotector](https://kaliiiiiiiiii.github.io/brotector/) ✅ ([CDP-Patches](https://github.com/Kaliiiiiiiiii-Vinyzu/CDP-Patches/) 사용 시)
- [Cloudflare](https://cloudflare.com/) ✅
- [Kasada](https://www.kasada.io/) ✅
- [Akamai](https://www.akamai.com/products/bot-manager/) ✅
- [Shape/F5](https://www.f5.com/) ✅
- [Bet365](https://bet365.com/) ✅
- [Datadome](https://datadome.co/products/bot-protection/) ✅
- [Fingerprint.com](https://fingerprint.com/products/bot-detection/) ✅
- [CreepJS](https://abrahamjuliot.github.io/creepjs/) ✅
- [Sannysoft](https://bot.sannysoft.com/) ✅
- [Incolumitas](https://bot.incolumitas.com/) ✅
- [IPHey](https://iphey.com/) ✅
- [Browserscan](https://browserscan.net/) ✅
- [Pixelscan](https://pixelscan.net/) ✅
---
## 버그
#### Patchright를 최대한 안정적으로 만들기 위해 많은 시간을 투자했지만, 여전히 버그가 발생할 수 있습니다. 버그를 발견하면 [Issues](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright/issues)에 보고해 주세요.
#### Patchright는 이제 매 릴리스 후 Playwright 테스트를 대상으로 테스트됩니다. [여기](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python/actions/workflows/patchright_tests.yml)를 참조하세요.
> [!WARNING]
> Patchright는 Playwright 테스트의 대부분을 통과하지만 전부는 아닙니다. 일부 버그는 해결이 불가능한 것으로 간주되며, 일부는 관련이 없습니다. 버그 목록과 그 설명은 [여기](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright/issues/30)를 참조하세요.
#### Playwright 테스트를 기반으로, 일반적인 사용 사례에서 이러한 버그의 영향을 받을 가능성은 매우 낮다고 결론지었습니다.
<details>
<summary><b>Init 스크립트 관련 문제</b></summary>
### 설명
[Runtime.enable](https://vanilla.aslushnikov.com/?Runtime.enable) 없이 InitScripts를 사용할 수 있도록, Patchright는 Playwright Routes를 사용하여 HTML 요청에 JavaScript를 주입합니다.
### 버그
Playwright Routes는 코드의 다른 부분에서 일부 버그를 유발할 수 있습니다. Patchright InitScripts는 일반 Playwright Routes로 인해 발생하지 않을 버그를 유발하지 않습니다. </br> 이러한 버그 중 하나라도 수정되기를 원하시면 Playwright 팀에 문의해야 합니다.
### 누출
Patchright InitScripts는 타이밍 공격(Timing Attack)으로 탐지될 수 있습니다. 그러나 현재 이 유형의 타이밍 공격을 검사하는 안티봇은 없으며, 상당 기간 동안 그럴 가능성도 낮습니다. </br> 우리는 이를 큰 탐지 위험으로 간주하지 않습니다.
</details>
---
### TODO
- [x] 실행 컨텍스트(Main/Isolated)를 선택할 수 있는 옵션 구현.
- [x] 수정 가능한 버그 수정.
- [x] Patchright의 패치를 쉽게 확인할 수 있는 .patch 업데이터 구현.
- [x] 새 릴리스에 대한 자동화된 테스트 설정.
- [x] .NET에서 Patchright 구현.
- [ ] Java에서 Patchright 구현.
---
## 개발
새로운 Patchright 버전의 배포는 자동으로 이루어지지만, Playwright 코드베이스 변경으로 인한 버그가 발생할 수 있습니다. 이러한 버그에 대한 수정은 릴리스까지 며칠이 걸릴 수 있습니다.
---
## 우리의 작업 지원하기
우리의 작업을 지원하기로 선택하셨다면, Discord에서 [@vinyzu](https://discord.com/users/935224495126487150) 또는 [@steve_abcdef](https://discord.com/users/936292409426477066)에게 연락해 주세요.
---
## 저작권 및 라이선스
© [Vinyzu](https://github.com/Vinyzu/)
Patchright는 [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) 라이선스로 배포됩니다.
[일부 코드](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright/blob/10c5a090e9a1dcd2107c253d65b3d8b27d0670a9/driver_patches/framesPatch.ts#L156-L171)는 [Driverless](https://github.com/kaliiiiiiiiii/Selenium-Driverless)에서 영감을 받았습니다.
.patch 파일 문서화 아이디어를 제공해 주신 [Nick Webson](https://github.com/rebrowser/rebrowser-patches)에게 감사드립니다.
---
## 면책 조항
이 저장소는 **교육 목적으로만** 제공됩니다. \
정확성, 완전성 또는 특정 목적에 대한 적합성에 대해 어떠한 보증도 제공하지 않습니다. **사용에 따른 책임은 사용자에게 있습니다**—저자 및 유지관리자는 이 코드의 사용, 수정 또는 배포로 인해 발생하는 **모든 손해**, **법적 문제** 또는 **보증 위반**에 대해 **어떠한 책임도 지지 않습니다**.\
**모든 오용 또는 법적 위반은 전적으로 사용자의 책임입니다**.
---
## 저자
#### 활성 유지관리자: [Vinyzu](https://github.com/Vinyzu/) </br> 공동 유지관리자: [Kaliiiiiiiiii](https://github.com/kaliiiiiiiiii/)