feiyun0112
Honored Contributor

If you want to capture browser screenshot, you can use playwright

%sh

pip install playwright
playwright install

sudo apt-get update
playwright install-deps  

 

from playwright.async_api import async_playwright

async with async_playwright() as p:
    browser = await p.chromium.launch()
    page = await browser.new_page()

    await page.goto("https://google.com")
    await page.screenshot(path="results.png", full_page=True)
    
    await browser.close()

 

 

View solution in original post