harvest-usage
Skill7 starsChanged 4 months agoMITView on GitHub
Практическое использование Harvest для веб-скрейпинга: scrape, extract, crawl. Конкретные команды и примеры из жизни.
- Installs packages
In this repository23 other files it gives its agents.
- content-pipelineSkill
- adaptive-loopsSkill
- api-cost-trackerSkill
- memory-compactorSkill
- memory-guardianSkill
- post-mortem-analyzerSkill
- reflexive-trigger-boostSkill
- skill-trigger-systemSkill
- agent-communicationSkill
- auto-qa-gatesSkill
- cost-aware-orchestratorSkill
- decision-frameworkSkill
- GitHub Publish WorkflowSkill
- network-restricted-hermesSkill
- omniroute-masterySkill
- reflection-qaSkill
- russia-hacksSkill
- self-hosted-aiSkill
- session-hygiene-plusSkill
- telegram-bot-patternsSkill
- tool-proficiency-trackerSkill
- trading-bot-deploymentSkill
- security-auditSkill
The file
Files
Harvest Usage — Практическое использование
Активировать: когда нужно собрать данные с веб-страницы.
Цель: Получить данные с сайта за 3 команды, без написания кода.
Зачем
Веб-скрейпинг — это боль. Playwright тормозит, BeautifulSoup ломается на динамических страницах, anti-bot блокирует. Harvest решает все эти проблемы одной командой.
Установка
pip install harvest-agentПроверь:
harvest --versionОсновные команды
1. harvest scrape — Полное содержимое страницы
# Просто текст (для чтения/анализа)
harvest scrape --mode full --output txt "https://example.com"
# С конкретными элементами
harvest scrape --selector ".price, .product-title" "https://example.com/pricing"
# JSON для программного использования
harvest scrape --mode economy --output json "https://example.com"Режимы:
full— безопасно, весь контент (по умолчанию)economy— экономит токены, только основноеhybrid— оба вариантаauto— умное определение
Формат вывода:
txt— простой текст (для LLM)json— структурированные данныеmd— Markdowncsv— таблица
2. harvest extract — Извлечение конкретных полей
# Извлечь цену, название и изображение
harvest extract --schema '{"price":".price", "title":"h1", "image":"img.product-photo"}' "https://example.com/product"
# Схема из файла
harvest extract --schema file://schema.json "https://example.com"Возвращает JSON:
{
"price": "$99.99",
"title": "Product Name",
"image": "https://example.com/photo.jpg"
}Если элемент не найден — null.
3. harvest crawl — Глубокий обход сайта
# Базовый обход
harvest crawl https://example.com
# Со скриншотом
harvest crawl https://example.com --screenshot shot.png
# С vision-извлечением (через GPT-4V)
harvest crawl https://example.com --vision
# Гибридный режим
harvest crawl https://example.com --mode hybrid-vision4. harvest batch — Пакетная обработка
# Обработать список URL из файла
harvest batch urls.txt --output results.json5. harvest compliance — Проверка robots.txt
harvest compliance https://example.com
harvest compliance https://example.com --format jsonПрактические примеры
Пример 1: Собрать цены с Wildberries
harvest scrape --selector ".product-card__price" --output json "https://www.wildberries.ru/catalog/12345/detail.aspx"Пример 2: Сравнить цены на Ozon
harvest extract --schema '{"name":".product-title", "price":".price-current", "rating":".rating-value"}' "https://www.ozon.ru/product/12345/"Пример 3: Собрать новости с Habr
harvest scrape --selector ".tm-title__link" --output txt "https://habr.com/ru/news/"Пример 4: Проверить доступность API
harvest compliance https://api.example.comПравила
- ВСЕГДА используй
--mode full --output txtдля чтения контента - ВСЕГДА проверяй
harvest complianceперед массовым скрейпингом - НИКОГДА не используй Harvest для API-вызовов (curl/httpx лучше)
- НИКОГДА не превышай rate limiting — 10 запросов/мин на домен
- Если что-то сломалось — попробуй
--mode economyили другой селектор
Частые ошибки
| Ошибка | Решение |
--css не работает | Используй --selector для scrape, --schema для extract |
| Пустой вывод | Попробуй другой CSS-селектор или --mode full |
| Anti-bot блокирует | Harvest уже имеет anti-bot, ноบาง sites могут блокировать |
| Нет JSON | Добавь --output json |
Продвинутое
Через Python (программно)
import asyncio
from harvest import Scraper
async def main():
scraper = Scraper()
result = await scraper.scrape("https://example.com", mode="full", output="txt")
print(result)
asyncio.run(main())Через MCP (для Hermes Agent)
# Harvest работает как MCP-сервер
harvest mcp serveHermes автоматически подключит Harvest как инструмент.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

