shiganluo/skill/bot-protected-scraping
Claude Code and agent skill by shiganluo/skill
- community
Checking that the SKILL.md file is still in the repository.
Use when headless Chrome is blocked by anti-bot detection.
Install
npx vskill@latest install shiganluo/skill/bot-protected-scrapingSKILL.md
Bot-Protected Site Scraping
When to Use
A site returns 403, empty shells, or "request abnormal" errors from both curl and headless Chrome. The blocked-page-recovery ladder (archive.org, Jina, API pivot) has been exhausted or is inapplicable. The user has a Chrome session with valid cookies for the target site.
When a site blocks headless Chrome (Zhihu, many Chinese platforms, sites behind DataDome/PerimeterX/Cloudflare Bot Management), the standard blocked-page-recovery ladder fails at step 5. This skill covers what comes after.
Prerequisite check: this skill applies when ALL of these are true:
- curl/wget returns a JS-only shell or challenge page (not real content)
web_extractfails or returns empty/error- Headless Chrome (puppeteer with
headless: true) gets 403 or
"request abnormal" JSON error
- The site is NOT a Wayback/archive candidate (live data needed, or
never archived)
Technique: xvfb-run + headed Chrome
Sites detect headless mode via navigator.webdriver, Chrome DevTools protocol artifacts, and missing compositor. Running headed Chrome under a virtual framebuffer (Xvfb) defeats all three — it's a real Chrome with a real X display, just invisible to the user.
Prerequisites
The script pattern
Run it:
Why not puppeteer-extra-plugin-stealth?
Stealth patches navigator.webdriver and a few other signals, but modern anti-bot (Zhihu's zse-ck, DataDone, PerimeterX) goes deeper — checking Chrome's internal DevTools protocol state, compositor availability, and canvas rendering. Headed mode under Xvfb passes all of these because it IS a real browser. Stealth is a patch; Xvfb is the real thing.
Login-required sites: Chrome profile + cookies
Many sites (Zhihu, LinkedIn, Twitter/X) require authentication. If the user has an active Chrome session with valid cookies, reuse them.
Step 1: Copy the Chrome profile
Chrome locks its profile directory while running. Copy to a temp location:
Step 2: Use the copied profile
Set userDataDir: '/tmp/chrome-profile' in puppeteer launch options. The headed Chrome instance will load cookies from the copied profile and authenticate with the target site automatically.
Step 3: If cookies are encrypted (manual extraction fallback)
Chrome v11 cookies on Linux use:
- Key:
PBKDF2HMAC(password=b'peanuts', salt=b'saltysalt', iterations=1, keylen=16, hash=SHA1) - IV: 16 zero bytes
- Algorithm: AES-128-CBC
- Prefix:
v11(3 bytes before ciphertext)
Decrypt with openssl:
When this works: headless servers without gnome-keyring. On desktop sessions, the profile-copy approach (Step 1-2) is simpler and more reliable because Chrome handles keyring decryption internally.
Pitfalls
- Don't use `headless: 'new'` — Chrome's "new headless" still exposes
detection signals. Use headless: false with xvfb-run.
- Don't use the live profile directory — Chrome locks it. Always copy
first.
- Don't retry the same headless approach — if headless Chrome gets
blocked once, switch to xvfb immediately. The anti-bot fingerprint is already flagged.
- Timeout generously — xvfb + headed Chrome is slower to start than
headless. Use 35-45s timeout for the node script.
- puppeteer-core, not puppeteer — puppeteer bundles its own Chromium
which may lack system fonts/locale. puppeteer-core uses system Chrome which has the user's real fonts and locale.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingweb/bot-protected-scraping/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/shiganluo/skill/bot-protected-scraping)