-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_docs_visual.py
More file actions
31 lines (25 loc) · 1.02 KB
/
Copy pathverify_docs_visual.py
File metadata and controls
31 lines (25 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import asyncio
from playwright.async_api import async_playwright
import os
async def capture():
async with async_playwright() as p:
browser = await p.chromium.launch()
page = await browser.new_page(viewport={'width': 1280, 'height': 3000})
files = {
'migrid-docs-roadmap.html': 'roadmap_main.png',
'docs/roadmap.html': 'roadmap_docs.png',
'docs/architecture.html': 'architecture.png',
'migridDocs.html': 'infographic.png'
}
for html_file, img_file in files.items():
if os.path.exists(html_file):
await page.goto(f'file://{os.path.abspath(html_file)}')
# Wait for any animations
await asyncio.sleep(1)
await page.screenshot(path=img_file, full_page=True)
print(f"Captured {html_file} to {img_file}")
else:
print(f"File not found: {html_file}")
await browser.close()
if __name__ == "__main__":
asyncio.run(capture())