Playwright won't run in headed mode for MacOS (I have xquartz)

62 Views Asked by At
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(headless=False, slow_mo=100)
    page = browser.new_page()
    page.goto("http://playwright.dev")
    print(page.title())
    browser.close()

Error: Looks like you launched a headed browser without having a XServer running. Set either 'headless: true' or use 'xvfb-run ' before running Playwright.

I reviewed the docs, installed xquartz and that didn't resolve the issue. The program runs in headless no problem. I couldn't find much on the issue.

0

There are 0 best solutions below