一键导入
scrape-ensure-project
Ensure a Scrapy project exists with scrapy-poet and Zyte API support
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Ensure a Scrapy project exists with scrapy-poet and Zyte API support
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Extract structured data (all available fields with values) from a page saved locally as an HTML file, optionally following a schema. Use this skill only to process already downloaded files. Do not invoke when the user provides a URL. When invoking, pass the user's full request verbatim as args — do not pre-parse file paths and don't rephrase it.
Analyze an HTML page to produce field extraction instructions for code generation
Generate web-poet page object code from per-page extraction analyses
Generate web-poet page object code from an extraction spec
Generate a Scrapy spider that wires page objects together
Create a new extraction spec from a URL — explore a detail page, discover fields, quick schema approval
| name | scrape-ensure-project |
| description | Ensure a Scrapy project exists with scrapy-poet and Zyte API support |
| argument-hint | [project-dir] [project-name] |
| allowed-tools | Bash, Read, Write |
You are ensuring a Scrapy project exists and is properly configured for web-poet page objects and Zyte API.
Read ${CLAUDE_SKILL_DIR}/../scrape/references/python-environments.md.
The raw argument string is $ARGUMENTS. Split it into 2 whitespace-separated positional arguments:
./books-project)books_project)If {project_dir}/pyproject.toml exists, this is an existing project. Go to step 3.
Otherwise, create the project from scratch (step 2).
Use the bundled cookiecutter template:
uvx cookiecutter --no-input ${CLAUDE_SKILL_DIR}/assets/project-template -o PARENT_DIR project_name=PROJECT_NAME
This creates a Scrapy project with:
pyproject.toml with dependencies (scrapy, scrapy-poet, scrapy-zyte-api, web-poet)scrapy.cfg with deploy settingssettings.py with scrapy-poet and Zyte API addons configuredpages/, spiders/, fixtures/ directoriesitems.py (empty, ready for item classes)Then install:
cd PROJECT_DIR && uv sync
Report what was created and return.
Read the project's pyproject.toml and check that these packages are in
dependencies:
scrapyscrapy-poetweb-poetextructprice-parserpytestIf any are missing, warn the user — list the missing dependencies and ask whether to add them. Do NOT modify the project without confirmation.
Also check that fixtures/ directory exists (create it if missing — it's just
a directory).
For new projects:
Created project at {project_dir}:
- {project_name}/settings.py — scrapy-poet + Zyte API configured
- {project_name}/items.py — ready for item classes
- {project_name}/pages/ — ready for page objects
- fixtures/ — ready for test fixtures
For existing projects:
Using existing project at {project_dir}.
Or if dependencies are missing:
Using existing project at {project_dir}.
Warning: missing dependencies: {list}
Add them to pyproject.toml?