# -*- coding: utf-8 -*- import re with open('index.html', encoding='utf-8') as f: html = f.read() required_products = ['包钢加固','火灾加固','梁柱加固','楼板加固','桥梁隧道加固','植筋加固','碳纤维加固','裂缝修补'] product_imgs = [ 'http://cdn.qiancipai.com/Image260914191024407bbd.jpg', 'http://cdn.qiancipai.com/Image26091419102476703d.jpg', 'http://cdn.qiancipai.com/Image260914191025142e02.jpg', 'http://cdn.qiancipai.com/Image260914191605268dff.jpg', 'http://cdn.qiancipai.com/Image260914191024907950.jpg', 'http://cdn.qiancipai.com/Image26091419102470442b.jpg', 'http://cdn.qiancipai.com/Image2609141910252676ac.jpg', 'http://cdn.qiancipai.com/Image26091419102414224f.jpg', ] banner = 'http://cdn.qiancipai.com/Image260916150037846614.png' about = 'http://cdn.qiancipai.com/Image26091614584183361d.png' checks = [] # 1. 三要素CDK title = re.search(r'(.*?)', html, re.S) keywords = re.search(r'name="keywords"\s+content="(.*?)"', html, re.S) desc = re.search(r'name="description"\s+content="(.*?)"', html, re.S) checks.append(('title存在且含百色+时间后缀', bool(title) and '广西百色' in title.group(1) and '更新时间:2026-09-16 20:38:42' in title.group(1))) checks.append(('keywords存在且优先百色', bool(keywords) and '广西百色' in keywords.group(1)[:20])) checks.append(('description存在且优先百色', bool(desc) and '广西百色' in desc.group(1)[:30])) # 2. 无用户输入模块 checks.append(('无表单/输入框/留言框', '