First time using playwright. Trying to log in to Pinterest.
browser = playwright.chromium.launch(headless=False)
context = browser.new_context()
page = context.new_page()
page.goto('https://pinterest.co.uk/login')
# Interact with login form
page.fill('input[name="id"]', email)
page.fill('input[name="password"]', password)
# looking for the login button. This part breaks.
page.locator('xpath=//*[@id="__PWS_ROOT__"]/div[1]/div/div[2]/div/div/div/div/div/div[4]/form/div[5]/button').click()
#open the form to create a pin
page.goto('https://www.pinterest.co.uk/pin-builder/')
I get a timeout error because it's waiting for the selector with the given xpath, but it's probably not finding it. Any ideas?