#!/usr/bin/env python3
"""Verify zhuhai content has HTML tables"""
import sqlite3, sys
sys.stdout.reconfigure(encoding='utf-8')

conn = sqlite3.connect("/root/search.db")
c = conn.cursor()
c.execute("SELECT id, length(content), substr(content, 1, 500) FROM gov_raw WHERE script_name='crawl_zhuhai_spqgs.py' LIMIT 1")
row = c.fetchone()
if row:
    print(f"#{row[0]}: {row[1]}chars")
    content = row[2]
    if '<table' in content:
        print("✅ 含HTML <table> 标签")
        # Show the table part
        idx = content.index('<table')
        print(f"  位置{idx}: {content[idx:idx+300]}")
    else:
        print("❌ 无HTML表格")
        print(f"  内容: {content[:200]}")
else:
    print("无数据")
conn.close()
