pybroswer
Python browser for PyDroid. No Chromium, Playwright, or PC host is required on the phone.
Browser.launch() fetches pages with httpx and parses HTML. The same API also works with remote Chromium.
Install (PyDroid)
pip install httpx
pip install https://github.com/prateeknishad305/Pybrowser/archive/refs/heads/master.zip
If that fails, install httpx first, then:
pip install git+https://github.com/prateeknishad305/Pybrowser.git
Import name:
from pybroswer import Browser
from pybrowser import Browser also works.
Check:
import pybroswer
print(pybroswer.__version__, pybroswer.__file__)
PyDroid usage
from pybroswer import Browser
with Browser.launch() as browser:
shot = browser.browse("https://example.com")
print(shot.title, shot.url, shot.text)
with browser.create_session(device="mobile") as page:
page.goto("https://example.com")
print(page.evaluate("document.title"))
page.click("a")
page.type("hello", selector="input[name=q]")
page.press("Enter")
print(page.html()[:500])
Browser() with no URL also starts the local HTTP engine.
Optional: PC Chromium
If you want real Chromium on a PC:
pip install "pybroswer[chromium]"
playwright install chromium
python -m pybroswer serve --port 5173
From PyDroid:
from pybroswer import Browser
with Browser.connect("http://192.168.1.10:5173") as browser:
...
In-process on PC: Browser.launch(engine="chromium").
Limits (phone HTTP engine)
- JS-heavy SPAs are not rendered (you get the HTML the server sent)
- Screenshot is a 1x1 placeholder PNG
evaluateonly supports simpledocument.title/querySelectorexpressions- Iframe contents are not fetched separately
- Click coordinates (
x, y) require Chromium
Forms, links, type/press/select, cookies, and redirects work.
API
| Method | |
|---|---|
Browser.launch() |
local HTTP engine (PyDroid default) |
Browser.launch(engine="chromium") |
Playwright Chromium (PC) |
Browser.connect(url) |
remote REST |
browser.browse(url) |
one-shot open |
page.goto / click / type / press / select |
session actions |
page.evaluate("document.title") |
read page |
page.html() / page.inspect(selector) |
DOM |
Metadata
Release files for pybroswer 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pybroswer-0.3.1.tar.gz | 26.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pybroswer-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.7 kB
Release files / pybroswer-0.3.1.tar.gz
| Download URL | pybroswer-0.3.1.tar.gz |
|---|---|
| Size | 26.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18a0b98a85d6fad56b57e64448e341fee0cb2a110dbc14f4d1a3a03417ea473a
|
|
BLAKE2b-256 checksum How to use checksums |
ec411fd2bb8a7340b3f46bcdd0a19fceec52c69074f3a7068ccb16967247ed6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / pybroswer-0.3.1-py3-none-any.whl
| Download URL | pybroswer-0.3.1-py3-none-any.whl |
|---|---|
| Size | 28.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0200e686b35b6a20a8eb908cf8ccb178e222deac1ce035f0b7deb3c1817eeeb2
|
|
BLAKE2b-256 checksum How to use checksums |
5da795d2d02a677dcd27275700881b421ab374f34be1d47daea30882d02438c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Security for pybroswer 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.