I tried all of this,
page.on("console", lambda msg: print(f"error: {msg.text}") if msg.type == "error" else None)
page.on("console", lambda msg: print(msg.text))
page.on("pageerror", lambda exc: print(f"uncaught exception: {exc}"))
Nothing works
Terminal output
python main.py
/home/xxx/.local/lib/python3.9/site-packages/trio/_core/_multierror.py:511: RuntimeWarning: You seem to already have a custom sys.excepthook handler installed. I'll skip installing Trio's custom handler, but this means MultiErrors will not show full tracebacks.
warnings.warn(