GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Playwright for Python
  • Docs
  • API
  • Python
  • Node.js
  • Java
  • .NET
  • Community
  • Classes
  • APIRequestContext
  • APIResponse
  • Browser
  • BrowserContext
  • BrowserType

This view

  • Original page
  • New address

GeezerVison is showing playwright.dev — WebError | Playwright Python

This is unreleased documentation for Playwright Python Next version.
For up-to-date documentation, see the latest version (stable).
Version: Next

WebError class represents an unhandled exception thrown in the page. It is dispatched via the browser_context.on("weberror") event.

  • Sync
  • Async
# 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>")

Properties​

error​

Added in: v1.38 webError.error

Unhandled error that was thrown.

Usage

web_error.error

Returns

  • Error#

location​

Added in: v1.60 webError.location

Usage

web_error.location

Returns

  • Dict#
    • url str

      URL of the resource.

    • line int

      0-based line number in the resource.

    • column int

      0-based column number in the resource.


page​

Added in: v1.38 webError.page

The page that produced this unhandled exception, if any.

Usage

web_error.page

Returns

  • NoneType | Page#
  • Properties
    • error
    • location
    • page
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.