mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-07-31 01:36:15 -04:00
pip-installable Python API driving the bundled binary over MCP HTTP: Browser/Session with one generated method per browser tool (lightpanda/_methods.py, regenerated from tools/list), run_script() replay, a CLI trampoline entry point, pytest suite against local fixtures, and pdoc docs generation.
25 lines
515 B
Python
25 lines
515 B
Python
"""Lightpanda for Python: a lightweight headless browser.
|
|
|
|
```python
|
|
from lightpanda import Browser
|
|
|
|
with Browser() as b:
|
|
page = b.new_session()
|
|
page.goto(url="https://example.com")
|
|
data = page.extract(schema={"title": "h1"})
|
|
```
|
|
"""
|
|
|
|
from .browser import Browser, Session, run_script
|
|
from .errors import LightpandaError, ProtocolError, ScriptError, ToolError
|
|
|
|
__all__ = [
|
|
"Browser",
|
|
"Session",
|
|
"run_script",
|
|
"LightpandaError",
|
|
"ProtocolError",
|
|
"ScriptError",
|
|
"ToolError",
|
|
]
|