← 返回
未分类 中文

Web Monitor

Monitor web pages for content changes with CSS selector targeting, change detection via hashing, and notification integration. Use for price tracking, conten...
使用 CSS 选择器定位网页内容,通过哈希检测变化并集成通知,适用于价格追踪、内容监控等。
dinghaibin
未分类 clawhub v1.0.0 1 版本 99591.8 Key: 无需
★ 0
Stars
📥 244
下载
💾 0
安装
1
版本
#latest

概述

Web Monitor — Page Change Detection & Alerts

Track web pages for content changes using hash-based comparison. Supports CSS selector extraction, interval-based monitoring, change history, and configurable notification delivery.

Quick Start

# Compare current page with previous snapshot
python scripts/monitor.py --url https://example.com --compare state.json

# Monitor with a CSS selector
python scripts/monitor.py --url https://example.com --selector ".price" --compare state.json

Usage

python scripts/monitor.py --url URL [OPTIONS]

Options:
  --url URL              Page URL to monitor (required)
  --selector SELECTOR    CSS selector to extract specific content
  --compare FILE         Compare with previous snapshot from FILE
  --state-file FILE      Save current state to FILE (default: state.json)
  --interval SEC         Auto-monitor at interval (seconds)
  --notify COMMAND       Command to run on change detected
  --json                 Output as JSON
  --max-retries N        Connection retries on failure (default: 3)

Examples

# Simple page check
python scripts/monitor.py --url https://example.com/page --compare state.json

# Monitor a price element
python scripts/monitor.py --url https://shop.example.com/product \
  --selector ".product-price" --compare price-state.json

# Continuous monitoring
python scripts/monitor.py --url https://example.com \
  --interval 3600 --compare state.json --notify "echo 'Changed!'"

# JSON output for pipeline
python scripts/monitor.py --url https://example.com --json

State File Format

{
  "url": "https://example.com/page",
  "selector": ".price",
  "hash": "sha256hash...",
  "timestamp": "2026-01-15T14:30:00Z"
}

Features

  • Hash-based change detection — reliable content comparison
  • CSS selector extraction — monitor specific page sections
  • State persistence — stores snapshots for comparison
  • Interval monitoring — automatic periodic checks
  • Notification hooks — trigger commands on changes
  • No external dependencies — uses only Python stdlib
  • SSL/HTTPS support — secure page fetching
  • JSON output — structured data for automation

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-21 14:47 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Automation Workflow

dinghaibin
创建并管理自动化工作流,以处理重复性任务。适用于需要安排周期性数据同步、链式API调用、设置触发动作等场景。
★ 0 📥 370

Unexpand Tool

dinghaibin
将文本文件中的空格转为制表符,保持统一缩进并减小文件大小。
★ 0 📥 388

Datetime Tool

dinghaibin
全面的日期时间操作工具包,支持多种格式、时区转换、日历计算、自然语言解析以及日期...
★ 0 📥 412