You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
565 B

1 day ago
# -*- coding: utf-8 -*-
"""票12 前侦察:扫描 demo/index.html 全部 function / section / dialog / 关键 id 行号"""
import io, re, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
p = r'e:\code\crm-backend-matt\.scratch\customer-demo-ref\demo\index.html'
lines = open(p, 'r', encoding='utf-8').read().splitlines()
pat = re.compile(r'^(async )?function (\w+)|<section id="([\w-]+)"|<dialog id="(\w+)"|id="(dlg\w+|tab\w*)"')
for i, ln in enumerate(lines, 1):
m = pat.search(ln)
if m:
print(f'{i}: {ln.strip()[:150]}')