BrowserSkill Browser Launcher
Paste the following prompt into your AI chat to install this skill:
Please refer to https://skillhub.cn/install/skillhub.md to install @user_656c2e70/bsk-browser-launcher.
About this skill
The Specific Problem It Solves
When using BrowserSkill (abbr. bsk) for web scraping or browser automation, a common prerequisite is having the local Edge browser open and the BrowserSkill extension connected to the local daemon. For scheduled tasks, CI/CD pipelines, or any unattended automation, this manual step of "launching the browser" becomes a blocking point. Scripts frequently fail with errors like browsers connected 0 or no browser is connected to the daemon, causing the entire automation pipeline to halt.
How the Skill Works
The core capability of the BrowserSkill Browser Launcher is to make the browser "self-available" within automation tasks. It is a pure control component, devoid of any business logic (e.g., login, data processing). Its workflow is encapsulated in the scripts/launch_browser.py script, with the following key steps:
- Connection Probing: First, it invokes the
bsk statuscommand to detect if any browser instance is already connected to the daemon. - Conditional Launch: If no connection is detected, the script automatically launches the locally installed Microsoft Edge browser. Since the BrowserSkill extension is set to start with the browser, it automatically connects to the daemon.
- Readiness Wait: After launch, the script enters a polling loop (defaulting to a max wait of 40 seconds, adjustable via the
--waitparameter) to continuously check the browser connection status. - Result Feedback: Upon successful connection, the script exits with code
0and prints a confirmation message. If the--start-sessionparameter is specified, it also outputs the new session identifier (SESSION=), allowing downstream tasks to use it directly.
It uses a clear set of exit codes to define handling for the caller:
- 0: Browser is ready; proceed with scraping or automation.
- 3: Connection timeout failure; the caller should consider a fallback strategy (e.g., use WebFetch directly) or mark the task.
- 4: Session creation failed; a retry may be attempted.
Applicable Boundaries and Considerations
This skill is a generic "launcher" with clear boundaries:
- Single Responsibility: It only handles launching the browser and ensuring the connection. It is unconcerned with what data is scraped or where it is published. Any scraping skill or automation task based on bsk should invoke it as a prerequisite step.
- Environmental Dependencies: Relies on the local Edge browser path (typically C:/Program Files (x86)/Microsoft/Edge/...) and the bsk daemon (~/.local/bin/bsk.exe). In non-standard environments, paths need confirmation.
- Statelessness and Security: The script contains no business credentials (appid/appsecret), managing only the browser lifecycle, and is safe for distribution.
- Asynchronous Connection Handling: After browser launch, the extension connection is asynchronous. The polling mechanism within launch_browser.py handles this, so callers do not need to implement their own sleep logic.
In summary, it is a foundational dependency library designed to eliminate the tedious and error-prone manual environment preparation step in automation tasks, allowing developers to focus more on the core business logic.
Use Cases
- In a scheduled nightly data scraping script, invoke this skill to automatically launch Edge and connect the extension, ensuring the latest price data from target websites can be captured.
- During the automated testing phase of a CI/CD pipeline, use this skill to proactively start the browser, providing a ready-to-use runtime environment for Selenium tests.
- As part of a weekly automated reporting workflow, unattendedly batch download PDF documents from an internal system; this skill handles the prerequisite browser startup and login.
- When building a cross-website content publishing pipeline, this skill ensures the browser and extension are automatically connected and available before each publishing task begins.
Best For
- A data engineer responsible for daily web scraping tasks, needing to eliminate the risk of automation script interruptions caused by manually starting the browser.
- A QA engineer in a DevOps team maintaining a test automation framework, looking to reduce the maintenance burden of browser configuration in test environments.
- A data analyst who downloads and consolidates data from multiple online platforms weekly for analysis, seeking a stable unattended download solution.
- A content operations person managing multiple social media accounts, aiming to automate the publishing workflow to avoid repetitive manual operations.
Related Skills
A fully local-run WeChat chat analysis tool with MBTI personality inference, sentiment analysis, risk detection, relationship health assessment, and conversation prediction, emphasizing privacy.
Fetches the top 20 A-share stocks by trading volume from Wencai, including ranking, price changes, and sectors, with sector analysis.
Performs project discrimination, classification, and structured extraction on bidding documents, outputting standardized data with support for manual review.
A data-model-based tool for quantitative football match analysis, offering verifiable frameworks such as win-draw-loss probabilities, upset risk assessments, and advancement path simulations.