Intelligent Web Scraper & Content Comprehension
Paste the following prompt into your AI chat to install this skill:
Please install @user_f12a44b7/self-dev-web-scraper according to the official guide at https://skillhub.cn/install/skillhub.md.
About this skill
Solution for Data Engineers
Extracting structured data from a list of URLs goes beyond a simple requests.get() call. Engineers typically face three core challenges: sites loading content via JavaScript, sophisticated anti-bot mechanisms, and the inefficiency of precisely extracting desired entities from cluttered HTML. A monolithic scraper script often fails at the outset or requires brittle, manual maintenance of selectors.
This skill provides a production-oriented, multi-strategy scraping solution. It is not just a crawler library, but a decision-making and execution framework designed to acquire target data with minimal cost and maximal success rates.
The Multi-Stage Pipeline and Key Design Choices
The core of the skill is a 5-stage cascade pipeline that follows a "lightest-to-heaviest" decision logic:
- News/Article Detection: It first uses URL patterns, Schema.org markup, and a content heuristic score to determine if the target page is a substantive content page worth deep crawling.
- Lightweight Download: It attempts a basic HTTP request using
requests. Success moves to the next stage; failure or detection of required rendering triggers an automatic escalation. - Robust Parsing: It leverages
BeautifulSouportrafilaturafor HTML cleaning and main content extraction, transforming raw HTML into clean plain text. - Dynamic Rendering: If the lightweight download fails or content loading depends on JavaScript, it employs
Playwrightfor headless browser rendering to ensure a complete DOM is obtained. - LLM Entity Extraction (Optional): Finally, on the clean text (not raw HTML), it uses a Large Language Model according to a predefined YAML config to extract specified entities (e.g., persons, key arguments, summaries).
Key design elements include:
* Mandatory Planning Protocol: A comprehensive assessment of the target, environment, and risks must be completed before any execution, preventing blind crawls that lead to IP bans or resource wastage.
* Declarative Configuration: Selectors and extraction rules are defined in YAML files, making maintenance and adaptation to site layout changes easier.
* Safety and Compliance: It strictly enforces rate limiting (minimum 0.5s intervals) and never reads or modifies credential files like .env directly; API keys are used via os.environ.get() only within generated scripts.
Considerations and Scope
This skill focuses on the compliant extraction of data from the public web. It does not support bypassing paywalls or unauthorized access requiring authentication. Its effectiveness relies on proper environment configuration (e.g., Playwright browser installation). It generates reproducible Python scripts and configurations, not a hosted service, so users must manage the runtime environment and output data themselves.
This solution is particularly suited for scenarios requiring the batch extraction of structured, standardized information from multiple heterogeneous websites, such as market research, competitive monitoring, or academic data collection.
Use Cases
- A market researcher needs to regularly scrape product announcement pages from competitor websites and tech media to extract features, pricing, and key descriptions for a competitive analysis report.
- A content curator is responsible for batch-scraping the main text of in-depth articles from industry-specific websites, cleaning out ads and navigation bars to generate clean text for internal team content trend analysis.
- A research assistant needs to automatically detect and extract article metadata (title, author, abstract, citations) from dozens of online academic resource pages to build a research database.
- A developer relations engineer must periodically monitor several third-party developer sites, scraping API documentation update notes and automatically identifying and extracting changed parameters and examples.
Best For
- A competitive intelligence analyst who needs to regularly and automatically monitor product and blog pages across multiple competitor sites to extract structured information, but wants to avoid manual browsing or writing separate scrapers for each site.
- A researcher who needs to collect the latest paper abstracts and citation information from a large number of academic websites with varying structures, but faces challenges from site anti-bot measures and dynamic content loading.
- A content strategy team lead who needs to batch-scrape in-depth reports or analysis articles from industry media and blogs to build a structured knowledge base, but finds the diverse HTML structures across sites difficult to process uniformly.
- A developer relations engineer who needs to quickly aggregate information on tool releases and discussions from various tech blogs, forums, and documentation sites to track technical trends, but some sites have content that loads dynamically via JavaScript.
Related Skills
A universal base component that automatically launches the Edge browser and connects the BrowserSkill extension, ensuring readiness for web scraping and browser automation tasks.
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.