10 lines
512 B
Python
10 lines
512 B
Python
import pathlib,json,html,re
|
|
root=pathlib.Path(__file__).resolve().parents[1]
|
|
for name in ['browser','mobile']:
|
|
file=root/f'docs/{name}-check-output.html'
|
|
source=file.read_text(encoding='utf-8-sig')
|
|
text=html.unescape(re.search(r'<pre id="result">(.*?)</pre>',source,re.S).group(1))
|
|
result=json.loads(text)
|
|
(root/f'docs/{name}-check-result.json').write_text(json.dumps(result,ensure_ascii=False,indent=2),encoding='utf8')
|
|
print(name,result.get('status',result.get('pass')),len(result.get('checks',[])))
|