diff --git a/templates/python-crawlee-playwright/src/main.py b/templates/python-crawlee-playwright/src/main.py index 5fec2e42..eb2db84c 100644 --- a/templates/python-crawlee-playwright/src/main.py +++ b/templates/python-crawlee-playwright/src/main.py @@ -32,6 +32,9 @@ async def main() -> None: # Limit the crawl to max requests. Remove or increase it for crawling all links. max_requests_per_crawl=50, headless=True, + browser_options={ + 'args': ['--disable-gpu'], + } ) # Define a request handler, which will be called for every request. diff --git a/templates/python-playwright/src/main.py b/templates/python-playwright/src/main.py index 17cdc092..c8fa8621 100644 --- a/templates/python-playwright/src/main.py +++ b/templates/python-playwright/src/main.py @@ -50,7 +50,7 @@ async def main() -> None: # Launch Playwright and open a new browser context. async with async_playwright() as playwright: # Configure the browser to launch in headless mode as per Actor configuration. - browser = await playwright.chromium.launch(headless=Actor.config.headless) + browser = await playwright.chromium.launch(headless=Actor.config.headless, args=['--disable-gpu']) context = await browser.new_context() # Process the URLs from the request queue.