Skip to content

Commit

Permalink
fix: pass --disable-gpu to Playwright in Python templates
Browse files Browse the repository at this point in the history
  • Loading branch information
barjin committed Dec 18, 2024
1 parent 56719db commit 2edef5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions templates/python-crawlee-playwright/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion templates/python-playwright/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2edef5a

Please sign in to comment.