I have the following code that automates the login to a particular site, in order to grab some value that is behind a login screen.
#!/usr/bin/python3
import asyncio
from pyppeteer import launch
browser = await launch( {'headless': True} );
page = await browser.newPage()
await page.goto(page_url1, {'waitUntil': 'networkidle2', 'timeout': '30000'})
# injecting username and password redacted
await asyncio.gather(
page.waitForNavigation({'waitUntil': 'networkidle2', 'timeout': '30000'}),
page.click('#submitButton')
)
# the line above got stuck or timed out
await browser.close()
pyppeteer.errors.TimeoutError: Navigation Timeout Exceeded: 30000 ms exceeded