browser-harness-auto-launch

Automates Chrome browser launching and web data extraction via browser-harness and CDP.

3|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/ZHLX2005/sl --skill browser-harness-auto-launch-zhlx2005
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: browser-harness-auto-launch
Source: https://github.com/ZHLX2005/sl/tree/main/skills/browser-harness-auto-launch
Command: npx skills add https://github.com/ZHLX2005/sl --skill browser-harness-auto-launch-zhlx2005

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually launching Chrome with remote debugging and handling shell-escaping issues makes browser automation fragile and slow. This Skill removes that friction by auto-starting Chrome, connecting via CDP, and providing proven patterns for web scraping and DOM extraction. ## Core Features & Use Cases - Automatic Chrome Launch: Connects to an existing Chrome on port 9222 or starts one automatically with a fixed temporary user-data-dir, never asking the user to do it manually. - Robust Script Execution: Avoids inline shell-escaping failures by writing Python scripts to files or falling back to CDP evaluate_script for direct JavaScript execution. - Bilibili Course Extraction: Includes a complete workflow for extracting BV video links from Bilibili collection pages, favorites, and UP主 spaces into a txt file for TabBoard batch import. - Use Case: Ask the agent to scrape all video links from a Bilibili collection page; it launches Chrome, scrolls to load lazy content, deduplicates BV links, filters recommendation noise, and outputs a clean course_videos.txt. ## Quick Start Use browser-harness to open the Bilibili collection page and extract all BV video links into a txt file.

Frequently Asked Questions about browser-harness-auto-launch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Chrome with browser-harness?

Run browser-harness with a command like browser-harness -c 'print(page_info())'. Its built-in ensure_daemon() automatically finds Chrome on port 9222 or launches it with remote debugging enabled, so no manual startup is needed.

How to extract video links from a Bilibili collection page?

Navigate to the page, scroll down repeatedly to trigger lazy loading, then run JavaScript matching href attributes against /video/BV patterns. Deduplicate with a Set and filter to the list container to exclude recommendation videos.

Why does browser-harness fail with inline JavaScript strings?

The -c argument is highly sensitive to quotes and escaping, so complex inline scripts cause SyntaxErrors. Write the script to a .py file and run exec(open('file').read()), or switch to CDP evaluate_script which has no shell escaping.

Does browser-harness require Chrome to be already running?

No. The run.py script calls ensure_daemon() internally, which connects to an existing Chrome on port 9222 or starts a new instance with a fixed temporary user-data-dir. A manual PowerShell fallback command exists for rare connection failures.

Why does SPA pagination extraction return stale data?

Single-page applications update the DOM asynchronously after clicks, so extracting immediately returns the old page. Add an explicit sleep of about 2 seconds after clicking next, or wait for a specific element change before extracting.