16 lines
668 B
Python
16 lines
668 B
Python
import os
|
|
import asyncio, sys
|
|
sys.path.insert(0, os.environ.get("SOLVER_PATH", "."))
|
|
import cloakbrowser
|
|
|
|
async def main():
|
|
async with await cloakbrowser.launch_async(humanize=False, headless=True) as br:
|
|
page = await br.new_page()
|
|
await page.set_viewport_size({"width": 1320, "height": 1000})
|
|
await page.goto("file:///" + os.path.join(os.path.dirname(os.path.abspath(__file__)), "dashboard.html").replace("\\", "/"))
|
|
await asyncio.sleep(1.5)
|
|
await page.screenshot(path=os.path.join(os.path.dirname(os.path.abspath(__file__)), "docs", "dashboard.png"), full_page=True)
|
|
print("screenshot saved")
|
|
|
|
asyncio.run(main())
|