| name | scrapling |
| description | 用于宿析OS授权范围内的 HTML 提取、抓取原型、选择器证据、解析器 fixture 和 OTA 页面字段提取。 |
Scrapling Skill
Scope
Use this skill when the task needs Scrapling, scraping, crawling, HTML parsing, selector evidence, parser fixtures, or OTA page field extraction.
Use suxi-plugin-priority-router before browser-assisted extraction. Prefer Browser for local verification and Chrome only when the user's authorized logged-in browser state is explicitly needed.
Scrapling is only a tool for authorized extraction experiments and parser implementation. It is not permission to bypass login, captcha, SMS verification, account authorization, robots restrictions, or OTA platform controls.
SUXIOS Boundaries
- Keep OTA channel scope separate from whole-hotel operating scope.
- Prefer response JSON and exported reports over DOM text when structured business data is available.
- Use DOM extraction only for visible page evidence, labels, rankings, summaries, or fields missing from captured business JSON.
- Do not fabricate values for missing fields, login failures, empty pages, or selector misses.
- Preserve explicit failure states: missing dependency, network failure, blocked request, login expired, selector not found, schema mismatch.
- Treat cookies, tokens, profile paths, phone numbers, account ids, and hotel ids as sensitive. Do not print or commit them.
- Do not modify business code, database schema, navigation, or protected OTA collection logic unless explicitly requested.
Before Implementation
- Read
HOTEL/AGENTS.md and task-relevant SUXIOS skills first.
- Check whether Scrapling is locally available:
python -m pip show scrapling
python -c "import importlib.util; print('installed' if importlib.util.find_spec('scrapling') else 'missing')"
- If Scrapling is missing, do not install it silently. Ask before running networked dependency installation.
- If package API details matter, verify the installed package version or official docs before writing code.
- Locate the existing data flow before changes:
route/app.php
app/controller/OnlineData.php
scripts/
- existing verifiers and tests
Implementation Pattern
For a Scrapling extractor:
- Define the target source: platform, collection mode, and business module.
- Define the evidence contract: source URL or local HTML path, selector or JSON path, extracted key, type, unit, missing-state label, and confidence.
- Keep raw evidence small and sanitized.
- Map extracted values only after the evidence contract is clear.
- Add focused verification for dependency presence, parser fixtures, missing selectors, and schema/type checks.
Preferred Output
For audits or plans, use a correction-ready table:
| Field | Source | Selector or Path | Type | Unit | Missing State | Storage Target | Confidence |
|---|
Do Not
- Do not bypass access controls or automation defenses.
- Do not scrape non-authorized hotel/account data.
- Do not hide failures behind fallback values.
- Do not turn OTA-only page data into whole-hotel occupancy, ADR, or RevPAR claims.
- Do not commit captured HTML, cookies, tokens, screenshots with sensitive data, or raw platform responses.