WebError
WebError クラスは、ページ内でスローされた未処理の例外を表します。これは、browser_context.on("weberror") イベントを介してディスパッチされます。
- 同期
- 非同期
# Log all uncaught errors to the terminal
context.on("weberror", lambda web_error: print(f"uncaught exception: {web_error.error}"))
# Navigate to a page with an exception.
page.goto("data:text/html,<script>throw new Error('test')</script>")
# Log all uncaught errors to the terminal
context.on("weberror", lambda web_error: print(f"uncaught exception: {web_error.error}"))
# Navigate to a page with an exception.
await page.goto("data:text/html,<script>throw new Error('test')</script>")
プロパティ
error
バージョン 1.38 で追加スローされた未処理のエラー。
使用法
web_error.error
戻り値
page
バージョン 1.38 で追加この未処理の例外が発生したページ(存在する場合)。
使用法
web_error.page
戻り値