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

# Try a detail page that returned empty content
url = "http://www.taiqian.gov.cn/content/2026/1287196.html"
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,application/xhtml+xml",
    url
], capture_output=True, text=True, timeout=30)
html = result.stdout
soup = BeautifulSoup(html, "html.parser")

print(f"Size: {len(html)} bytes")
print("TITLE:", soup.title.string.strip()[:60] if soup.title else "N/A")

# Find ALL div classes
for div in soup.find_all("div", class_=lambda x: x):
    cls = " ".join(div.get("class", []))
    txt = div.get_text(strip=True)
    if len(txt) > 100:
        print(f"  class='{cls[:50]}' len={len(txt)}: {txt[:80]}...")

# Check the show-content specifically
sc = soup.find("div", class_="show-content")
if sc:
    print(f"\nshow-content: '{sc.get_text(strip=True)[:200]}'")
else:
    print("\nNo show-content div!")
