github microsoft/playwright-python v1.29.0

latest releases: v1.43.0, v1.42.0, v1.41.2...
16 months ago

Highlights

New APIs

  • New method Route.fetch and new option json for Route.fulfill:

    def handle_route(route: Route):
      # Fetch original settings.
      response = route.fetch()
      # Force settings theme to a predefined value.
      json = response.json()
      json["theme"] = "Solorized"
      # Fulfill with modified data.
      route.fulfill(json=json)
    page.route("**/api/settings", handle_route)
  • New method Locator.all to iterate over all matching elements:

    # Check all checkboxes!
    checkboxes = page.get_by_role("checkbox")
    for checkbox in checkboxes.all():
      checkbox.check()
  • Locator.select_option matches now by value or label:

    <select multiple>
      <option value="red">Red</div>
      <option value="green">Green</div>
      <option value="blue">Blue</div>
    </select>
    element.select_option("Red")

Miscellaneous

Browser Versions

  • Chromium 109.0.5414.46
  • Mozilla Firefox 107.0
  • WebKit 16.4

This version was also tested against the following stable channels:

  • Google Chrome 108
  • Microsoft Edge 108

Don't miss a new playwright-python release

NewReleases is sending notifications on new releases.