seo-analyzer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

SEO Analyzer Skill

SEO Analyzer Skill

基于 Google 官方文档的 SEO 自动检测工具。自动分析网址的技术 SEO、内容元数据、性能体验和链接结构,输出符合 Google 最佳实践的检测报告。
An automated SEO testing tool based on official Google documentation. It automatically analyzes a website's technical SEO, content metadata, performance experience, and link structure, and outputs a test report that aligns with Google's best practices.

快速开始

Quick Start

自动模式(推荐)

Auto Mode (Recommended)

使用自动模式分析 URL,脚本会自动获取页面并执行检查:
bash
python scripts/seo_analyzer.py --auto <url>
自动模式会:
  1. 检查 agent-browser 是否已安装
  2. 使用 agent-browser 获取页面 HTML
  3. 执行完整的 SEO 检查
  4. 生成详细的检测报告
Use auto mode to analyze a URL, the script will automatically fetch the page and perform checks:
bash
python scripts/seo_analyzer.py --auto <url>
Auto mode will:
  1. Check if agent-browser is installed
  2. Use agent-browser to fetch page HTML
  3. Perform a full SEO check
  4. Generate a detailed test report

手动模式

Manual Mode

如果 agent-browser 未安装,或已有 HTML 文件:
bash
undefined
If agent-browser is not installed, or you already have an HTML file:
bash
undefined

从文件分析

Analyze from file

python scripts/seo_analyzer.py <html_file> <url>
python scripts/seo_analyzer.py <html_file> <url>

从 stdin 读取

Read from stdin

agent-browser get source | python scripts/seo_analyzer.py - <url>
agent-browser get source | python scripts/seo_analyzer.py - <url>

JSON 输出格式

JSON output format

python scripts/seo_analyzer.py <html_file> <url> --json
undefined
python scripts/seo_analyzer.py <html_file> <url> --json
undefined

工作流程

Workflow

分析网页 SEO 时,按以下步骤执行:
  1. 获取页面内容 - 使用 agent-browser 打开页面并获取 HTML
  2. 执行 SEO 检查 - 运行
    seo_analyzer.py
    分析页面
  3. 生成报告 - 输出按严重程度分类的问题和建议
When analyzing webpage SEO, follow these steps:
  1. Fetch Page Content - Use agent-browser to open the page and get HTML
  2. Execute SEO Check - Run
    seo_analyzer.py
    to analyze the page
  3. Generate Report - Output issues and recommendations categorized by severity

完整工作流程示例

Complete Workflow Examples

bash
undefined
bash
undefined

方式1: 自动模式(推荐)

Method 1: Auto Mode (Recommended)

python scripts/seo_analyzer.py --auto https://example.com
python scripts/seo_analyzer.py --auto https://example.com

方式2: 分步执行

Method 2: Step-by-step execution

agent-browser open <url> --timeout 30000 agent-browser get source | python scripts/seo_analyzer.py - <url>
agent-browser open <url> --timeout 30000 agent-browser get source | python scripts/seo_analyzer.py - <url>

方式3: 使用文件

Method 3: Use file

agent-browser get source > /tmp/page.html python scripts/seo_analyzer.py /tmp/page.html <url>
undefined
agent-browser get source > /tmp/page.html python scripts/seo_analyzer.py /tmp/page.html <url>
undefined

检查类别

Check Categories

分析器检查以下 12 个 SEO 类别:
  1. 技术要求 - HTTP 状态码、Googlebot 可访问性、HTTPS、noindex 指令
  2. 标题标签 -
    <title>
    存在性、唯一性、描述性、避免关键字堆砌
  3. Meta 描述 - 存在性、唯一性、描述性、适当长度
  4. 标题结构 - H1 存在性和唯一性、逻辑层级
  5. 链接可访问性 - 标准链接格式、描述性锚文本、rel 属性
  6. 图片优化 - alt 属性、描述性文本
  7. 结构化数据 - JSON-LD/Microdata/RDFa 存在性、有效性
  8. URL 结构 - 描述性、可读性、使用连字符
  9. Canonical URL - 存在性、绝对路径、HTTPS 优先
  10. 内容质量 - 独特性、可读性、实质性内容
  11. 移动端友好性 - viewport 标签、响应式设计
  12. Core Web Vitals - LCP、INP、CLS(需要 JavaScript 运行时测量)
详细检查规则和实现逻辑见
references/seo-check-rules.md
The analyzer checks the following 12 SEO categories:
  1. Technical Requirements - HTTP status code, Googlebot accessibility, HTTPS, noindex directive
  2. Title Tags - Existence, uniqueness, descriptiveness, avoiding keyword stuffing
  3. Meta Descriptions - Existence, uniqueness, descriptiveness, appropriate length
  4. Heading Structure - Existence and uniqueness of H1, logical hierarchy
  5. Link Accessibility - Standard link format, descriptive anchor text, rel attributes
  6. Image Optimization - Alt attributes, descriptive text
  7. Structured Data - Existence and validity of JSON-LD/Microdata/RDFa
  8. URL Structure - Descriptiveness, readability, use of hyphens
  9. Canonical URL - Existence, absolute path, HTTPS priority
  10. Content Quality - Uniqueness, readability, substantial content
  11. Mobile Friendliness - Viewport tag, responsive design
  12. Core Web Vitals - LCP, INP, CLS (requires JavaScript runtime measurement)
Detailed check rules and implementation logic can be found in
references/seo-check-rules.md
.

报告格式

Report Format

报告按严重程度分类问题:
  • Critical(严重) - 必须修复,会阻止索引/排名
  • Warning(警告) - 应该修复,影响性能
  • Info(建议) - 优化建议,改善表现
报告包含:
  • 问题摘要(总数、各严重程度数量)
  • 详细问题列表(类别、当前状态、建议、参考文档)
  • 通过的检查项
使用
--json
参数可输出 JSON 格式报告,便于程序化处理。
Reports categorize issues by severity:
  • Critical - Must be fixed, will prevent indexing/ranking
  • Warning - Should be fixed, affects performance
  • Info - Optimization recommendations to improve performance
Reports include:
  • Issue summary (total count, count by severity level)
  • Detailed issue list (category, current status, recommendation, reference documentation)
  • Passed check items
Use the
--json
parameter to output reports in JSON format for programmatic processing.

参考资源

Reference Resources

  • 检查规则:
    references/seo-check-rules.md
    - 详细的检查规则和实现逻辑
  • Google SEO 文档: seo-docs - 基于 Google 官方文档的完整参考
  • Check Rules:
    references/seo-check-rules.md
    - Detailed check rules and implementation logic
  • Google SEO Documentation: seo-docs - Complete reference based on official Google documentation

限制说明

Limitations

  • 无法测量 Core Web Vitals(需要 JavaScript 运行时)
  • 无法验证页面是否已被 Google 索引
  • 无法访问服务器配置(SSL、重定向等)
  • 内容质量评估基于启发式方法
  • 移动端友好性检查为近似值,非实际设备模拟
  • Cannot measure Core Web Vitals (requires JavaScript runtime)
  • Cannot verify if pages have been indexed by Google
  • Cannot access server configurations (SSL, redirects, etc.)
  • Content quality assessment is based on heuristic methods
  • Mobile friendliness checks are approximate, not actual device simulation