360 Secure SkillHub
360 安全技能中心

Cn Url Health Checker

通过 Python 脚本向指定 URL 发起 HTTP 请求,返回状态码、重定向链、最终 URL 与错误信息,用于排查失效链接和服务器错误。仅依赖标准库,无需 API Key;只支持单条 URL,不包含批量检查或定时监控。

freedompixels
freedompixels
热度 44.17
最近更新 2026-06-07 10:37:08
分类:自动化依赖:代码执行应用场景:DevOps / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add cn-url-health-checker
Metadata
slug
cn-url-health-checker
name
URL Health Checker
version
1.0.0
description
Check URL health status (HTTP response code, redirect chain). Detect broken links and server errors. Pure Python standard library, no API key required.
keywords
url, http, status, health, check
license
MIT-0
tags
["tools"]

URL Health Checker

Check the health status of any URL.

Features

  • Get HTTP status code (200, 404, 500, etc.)
  • Follow redirect chains
  • Detect server errors
  • Report final URL after redirects
  • Pure Python, no external dependencies

HTTP Status Codes

  • 200: OK (working)
  • 301/302: Redirect (may need attention)
  • 404: Not Found (broken link)
  • 500: Server Error (problem on server side)
  • Other codes: Various issues

Usage

python3 scripts/url_health.py --url https://example.com

Example Output

{
  "url": "https://example.com",
  "status": 200,
  "final_url": "https://example.com",
  "redirects": [],
  "error": null
}

Example (Broken Link)

{
  "url": "https://example.com/nonexistent",
  "status": 404,
  "error": "HTTP Error 404: Not Found"
}

Use Cases

  • Check if your website pages are accessible
  • Find broken links in your content
  • Monitor external resource availability

出品: AISoBrand|爱索品牌 — AI搜索优化工具
官网: https://aisobrand.com
免费检测你的品牌在AI搜索中有没有存在感 → 30秒出结果