ホーム/安全与合规/playwright-bot-bypass
P

playwright-bot-bypass

by @greekr4v
4.9(15)

Playwrightを使用してボット検出を回避します。アンチスクレイピングまたはアンチオートメーションメカニズムを回避する要求がある場合に、効果的な技術戦略と実装方法を提供します。

PlaywrightBot DetectionAnti-Bot MeasuresWeb ScrapingBrowser AutomationSecurity BypassesGitHub
インストール方法
npx skills add greekr4/playwright-bot-bypass --skill playwright-bot-bypass
compare_arrows

Before / After 効果比較

1
使用前

自動化スクリプトは、ウェブサイトのボット検出メカニズムによって頻繁に識別され、ブロックされるため、意図したタスクを完了できません。これにより、効率が低下します。

使用後

Playwrightを活用してボット検出を回避し、自動化スクリプトのスムーズな実行を保証します。これにより、自動化タスクの成功率と効率が大幅に向上します。

description SKILL.md


name: playwright-bot-bypass description: This skill should be used when the user asks to "bypass bot detection", "avoid CAPTCHA", "stealth browser automation", "undetected playwright", "bypass Google bot check", "rebrowser-playwright", or needs to automate websites that detect and block bots. version: 1.0.0

Playwright Bot Bypass

Bypass bot detection systems using rebrowser-playwright with stealth techniques. This approach successfully passes bot detection tests like bot.sannysoft.com and enables automation on sites with aggressive bot protection (Google, Cloudflare, etc.).

Why Standard Playwright Gets Detected

Standard Playwright/Puppeteer exposes several automation signatures:

Detection PointStandard PlaywrightThis Solution
WebDriver propertynavigator.webdriver = trueRemoved
WebGL RendererSwiftShader (software)Real GPU (Apple M2, etc.)
User AgentContains "HeadlessChrome"Clean Chrome UA
Chrome runtimeMissing propertiesComplete chrome.runtime

Quick Start

1. Install Dependencies

npm install rebrowser-playwright

2. Basic Stealth Script

import { chromium } from 'rebrowser-playwright';

const browser = await chromium.launch({
  headless: false,
  channel: 'chrome'  // Use real Chrome browser
});

const context = await browser.newContext();

// Remove WebDriver property
await context.addInitScript(() => {
  delete Object.getPrototypeOf(navigator).webdriver;
});

const page = await context.newPage();
await page.goto('https://example.com');

Key Components

rebrowser-playwright

Drop-in replacement for playwright that patches automation detection:

  • Uses real GPU instead of SwiftShader
  • Removes HeadlessChrome from User Agent
  • Patches various fingerprinting vectors

addInitScript for WebDriver

The navigator.webdriver property is the most common detection method:

await context.addInitScript(() => {
  delete Object.getPrototypeOf(navigator).webdriver;
});

Real Chrome Browser

Always use channel: 'chrome' to launch the user's installed Chrome:

chromium.launch({
  headless: false,
  channel: 'chrome'
});

Complete Example

See examples/stealth-google-search.mjs for a complete working example that:

  1. Bypasses bot detection
  2. Performs Google search
  3. Captures results

Testing Bot Detection

Verify bypass effectiveness at https://bot.sannysoft.com:

node scripts/bot-detection-test.mjs

All items should show green (passed).

Scripts

  • scripts/bot-detection-test.mjs - Test bot detection status
  • scripts/stealth-template.mjs - Reusable stealth browser template

Examples

  • examples/stealth-google-search.mjs - Google search without CAPTCHA
  • examples/ab-test.mjs - Compare detected vs stealth side-by-side
  • examples/stealth-twitter-scrape.mjs - Twitter/X profile scraping without login

Limitations

  • Requires headless: false (headed mode)
  • Needs real Chrome installed (channel: 'chrome')
  • Some sites may still detect based on behavior patterns
  • Does not bypass CAPTCHAs, only prevents triggering them

Python Support

playwright-stealth (Limited)

Python playwright-stealth cannot fully bypass bot detection.

Environmentbot.sannysoft.comGoogle Search
Node.js rebrowser-playwright✅ Pass✅ Works
Python playwright-stealth✅ Pass❌ CAPTCHA

Why?

  • rebrowser-playwright: Chromium binary-level patch → uses real GPU
  • playwright-stealth: JavaScript-level patch only → SwiftShader exposed

undetected-chromedriver (Recommended for Python)

undetected-chromedriver fully bypasses bot detection in Python!

Librarybot.sannysoft.comGoogle Search
playwright-stealth✅ Pass❌ CAPTCHA
undetected-chromedriver✅ PassWorks!

Installation

pip install undetected-chromedriver

Usage

import undetected_chromedriver as uc

# Check your Chrome version at chrome://version
driver = uc.Chrome(version_main=133)

driver.get("https://www.google.com")
search_box = driver.find_element("name", "q")
search_box.send_keys("your search query")
search_box.submit()

Key Points

  • Uses Selenium WebDriver API (not Playwright)
  • Automatically patches ChromeDriver to avoid detection
  • Requires specifying version_main matching your Chrome version
  • Check Chrome version: chrome://version

Alternative: Subprocess

For Electron/Node.js apps, call Node.js script from Python:

import subprocess
result = subprocess.run(['node', 'stealth-script.mjs', query], capture_output=True)

Troubleshooting

Still Getting Detected?

  1. Ensure using rebrowser-playwright, not playwright
  2. Verify channel: 'chrome' is set
  3. Check addInitScript runs before navigation
  4. Try adding delays between actions (human-like behavior)

Browser Not Opening?

# macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version

# Windows
"C:\Program Files\Google\Chrome\Application\chrome.exe" --version

# Linux
google-chrome --version

WebGL Still Shows SwiftShader?

This happens with regular playwright. Confirm import is from rebrowser-playwright:

// Correct
import { chromium } from 'rebrowser-playwright';

// Wrong - will be detected
import { chromium } from 'playwright';

forumユーザーレビュー (0)

レビューを書く

効果
使いやすさ
ドキュメント
互換性

レビューなし

統計データ

インストール数573
評価4.9 / 5.0
バージョン
更新日2026年3月16日
比較事例1 件

ユーザー評価

4.9(15)
5
0%
4
0%
3
0%
2
0%
1
0%

この Skill を評価

0.0

対応プラットフォーム

🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI

タイムライン

作成2026年3月16日
最終更新2026年3月16日