Fix malformed README quickstart fence and non-runnable timeout snippet

Aperta Adatta ai principianti
#176 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
documentation

Direzione di ricerca

Inizia in README.md alle righe 27-68 esaminando il fence del quickstart, quindi rivedi l'esempio di timeout alle righe 230-247. Mantieni il quickstart completo all'interno di un singolo fence Python e assicurati che lo snippet di timeout includa il relativo import richiesto. Esegui il rendering del README ed esegui gli snippet autonomi per verificare che gli esempi siano eseguibili.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
93
Fork
16
Merge medio
11m
PR unite (30g)
3

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di browserbase/sdk-python

Tutte le issue di browserbase/sdk-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.