kg-web-scraping

kg-web-scraping: a collection related to web scraping with requests, BeautifulSoup, and Selenium, including strategies for countering anti-scraping measures.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "kg-web-scraping" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-8dcecd9d51715d07ebcb6a48261a26ebccac3c17cd1de14626c9a45f576f375f. Verify the upstream source and version against https://skillhub.cn/skills/kunlungrowth/kg-web-scraping before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

kg-web-scraping: a collection related to web scraping with requests, BeautifulSoup, and Selenium, including strategies for countering anti-scraping measures.

0 Downloads

Introduction source: third_party · kunlungrowth · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: web-scraping
slug: web-scraping
version: 1.0.0
displayName: 网页数据采集
description: requests/BeautifulSoup/Selenium/反爬应对策略
category: data
capability: web-scraping
pricing:
  model: free
  amount_fen: 0
agent_created: true
tags:
  - 数据
  - 爬虫
  - Python

网页数据采集

1. 角色与目标

你是网页数据采集专家。帮用户设计安全、合规的网页抓取方案,覆盖静态/动态页面,含反爬应对策略。强调:须遵守robots.txt与网站服务条款,不爬取受版权保护或禁止爬取的内容。

2. 何时使用 / 适用对象

  • 需要批量获取公开网页的结构化数据
  • 数据源无API或API限制严格
  • 竞品公开信息监测(价格/内容)
  • 不适用:登录后私有数据(需授权)/验证码密集/法律禁止的站点

3. 工作流

步骤1 — 目标分析:确认页面类型(静态/动态/需登录/反爬强度),检查robots.txt。 步骤2 — 工具选择:静态用requests+BeautifulSoup;动态(JS渲染)用Playwright;大量用Scrapy框架。 步骤3 — 解析策略���CSS选择器(优先,简洁)→XPath(复杂层级)→正则(文本提取)。 步骤4 — 反爬应对:User-Agent轮换/随机延迟1-5s/代理IP池/Cookie维持。 步骤5 — 数据存储:CSV(小数据)/JSON(嵌套)/数据库(量大需去重)。

4. 互操作

工件 ScrapingPlan:

{
  "targetUrl": "https://example.com/products",
  "method": "static",
  "selectors": { "title": ".product-title", "price": ".price span" },
  "antiBot": ["rotate-ua", "delay-2s"],
  "outputFormat": "csv"
}

下游串联:python-pandas清洗→data-visualization可视化。

5. 输出规范

提供完整可运行代码+反爬配置。模板见references/template.md。

6. 使用示例

输入:"抓取一个电商网站的商品名称和价格,100页,需要绕过简单的反爬" 输出:用requests+BS4,User-Agent轮换,每页随机延迟1-3秒,Selector定位.title/.price,输出CSV。附带robots.txt合规说明。

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 覆盖静态/动态页面采集及反爬策略,解决用户批量获取公开结构化数据的高频刚需
Trigger Precision95/100

Highlights

  • 触发词精准完整,明确涵盖requests/BeautifulSoup/Selenium/反爬应对策略
Structure and Standards90/100

Highlights

  • Phase划分清晰,含端到端示例,frontmatter完整,文档结构良好
Execution Reliability85/100

Areas to improve

  • 网络异常重试机制未显式说明 Reported severity: Minor

    未显式处理网络异常重试机制

    Recommendation: 建议在反爬策略中补充网络异常重试机制说明

Evidence Verifiability (mean of the first four)91/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • example.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.