Skip to content

Fix malformed README quickstart fence and non-runnable timeout snippet #176

Description

@abhinavkr26104

Description

The README quickstart closes its Python fence immediately after session creation (README.md:43), leaving the Playwright run() function as plain Markdown, then opens an unintended fence at README.md:67. This corrupts the rendered structure around the primary usage example and the following Examples section.

A second runnable-snippet problem appears in the timeout example: README.md:241 calls httpx.Timeout(...), but that code block imports only Browserbase and never imports httpx.

Reproduction

  1. Render README.md on GitHub/PyPI, or track fence state from lines 27-68.
  2. Observe that lines 46-66 are outside the Python block and line 68 (## Examples) is inside the next fence.
  3. Copy the timeout block at lines 230-247 into a Python process; it raises NameError: name 'httpx' is not defined at line 241.

Expected behavior

  • The entire quickstart (imports, session creation, run(), and main guard) should be within one Python fence.
  • Each advertised standalone snippet should contain the imports it needs, including import httpx for the granular timeout example.

Actual behavior

The primary README example is malformed when rendered, and the timeout example is not executable as shown.

Why it matters

README content is also used for the package metadata/PyPI page, so these errors affect the first-run path for both GitHub and PyPI users. A lightweight docs test that extracts/compiles Python fences would prevent recurrence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions