#!/usr/bin/env python3
import sys, re, subprocess
from bs4 import BeautifulSoup

urls = [
    "http://www.taiqian.gov.cn/content/2026/1290326.html",
    "http://www.taiqian.gov.cn/content/2026/1287196.html",
    "http://www.taiqian.gov.cn/content/2026/1288558.html",
]
for url in urls:
    result = subprocess.run([
        "curl", "-sL", "--max-time", "15",
        "-H", "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
        "-H", "Accept: text/html",
        url
    ], capture_output=True, text=True, timeout=30)
    html = result.stdout
    status = len(html)
    soup = BeautifulSoup(html, "html.parser")
    
    # Check if there's a show div
    show = soup.find("div", class_="show") or soup.find("div", class_="show-content")
    show_len = len(show.get_text(strip=True)) if show else 0
    
    # Check if it's an error page
    is_error = "Internal Server Error" in html or "404" in html[:500]
    
    print(f"{url.split('/')[-1]} size={status} show={show_len} error={is_error}")
