13. Modern Web Automation with Playwright Python

Playwright Python Architecture

Playwright offers both synchronous and asynchronous APIs: - Synchronous (sync_api): Ideal for test scripts and standard pytest automation suites. - Asynchronous (async_api): Ideal for high-concurrency web scrapers and asyncio apps.
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page()
page.goto("https://targetqa.com")
print("Page Title:", page.title())
browser.close()

Task

  • Implement get_browser_engines():
  • 1. Return ['chromium', 'firefox', 'webkit'].
πŸ’‘Common doubts
Did you like the problem?
Lesson 13 of 37
Python
Loading code editor…
Next