from playwright.sync_api import sync_playwright
playwright = sync_playwright().start()
browser = playwright.chromium.launch()
page = browser.new_page()
page.goto('https://news.ycombinator.com/login?goto=news')
page.get_by_label('username').fill('mherrmann')
# playwright._impl._errors.TimeoutError: Locator.fill: Timeout 30000ms exceeded.
I suspect Playwright expects there to be a <label> for an <input> element.It does work with Helium:
from helium import *
start_chrome('https://news.ycombinator.com/login?goto=news')
write('mherrmann', into='username')
The two scripts are equivalent, except Helium's works and is half as long.