Browser engine in a library — fetch, render, and extract web content.
Project description
servo-fetch
Python bindings for servo-fetch — fetch, render, and extract web content with an embedded Servo browser engine.
- No Chromium — single binary, no browser download
- JavaScript execution — full Servo engine with SpiderMonkey
- Schema extraction — declarative CSS-selector → structured JSON, no LLM
- Async-ready —
asyncio.to_threadwrappers,AsyncClientwith streaming crawl - Typed — full
.pyistubs, works with ty / mypy / pyright
Install
pip install servo-fetch
Quick Start
import servo_fetch
page = servo_fetch.fetch("https://example.com")
page.html # rendered HTML
page.inner_text # document.body.innerText
page.markdown # readable Markdown (lazy, cached)
page.title # str | None
Schema Extraction
from servo_fetch import Schema, Field
schema = Schema(
base_selector=".product",
fields=[
Field(name="title", selector="h2", type="text"),
Field(name="price", selector=".price", type="text"),
Field(name="url", selector="a", type="attribute", attribute="href"),
],
)
page = servo_fetch.fetch("https://shop.example.com", schema=schema)
page.extracted # [{"title": "...", "price": "...", "url": "..."}]
Async
from servo_fetch import fetch_async, AsyncClient
page = await fetch_async("https://example.com")
async with AsyncClient(user_agent="MyBot/1.0") as client:
async for page in client.crawl_stream("https://docs.example.com", max_pages=50):
print(page.url, page.title)
Develop
Requires uv.
uv sync --group all # create venv + install dev deps
uv run maturin develop # build extension (debug, fast compile)
uv run pytest # run tests
uv run ruff check python tests # lint
uv run ty check python # type check
Troubleshooting
Linux: "cannot allocate memory in static TLS block"
Servo's native extension uses large thread-local storage. On some Linux systems, set before importing:
export GLIBC_TUNABLES=glibc.rtld.optional_static_tls=16384
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file servo_fetch-0.10.0-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: servo_fetch-0.10.0-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 33.2 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9afbfd6d87797d7f17ba0aa87a7ceb7d9256183ba3908ecc00be9c7509fae1e
|
|
| MD5 |
104702fb392d99ac6b99846cd359f0ce
|
|
| BLAKE2b-256 |
e46e5e506175cbf12215fa9aceea6ec99b2e5224dd2de3da523034c6daf510c0
|
Provenance
The following attestation bundles were made for servo_fetch-0.10.0-cp310-abi3-win_amd64.whl:
Publisher:
release-python.yml on konippi/servo-fetch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
servo_fetch-0.10.0-cp310-abi3-win_amd64.whl -
Subject digest:
d9afbfd6d87797d7f17ba0aa87a7ceb7d9256183ba3908ecc00be9c7509fae1e - Sigstore transparency entry: 1548400643
- Sigstore integration time:
-
Permalink:
konippi/servo-fetch@4dfe2efe8718985a216f221fdc3817d3e60d7e2c -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/konippi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@4dfe2efe8718985a216f221fdc3817d3e60d7e2c -
Trigger Event:
push
-
Statement type:
File details
Details for the file servo_fetch-0.10.0-cp310-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: servo_fetch-0.10.0-cp310-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 37.5 MB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9738e4c33a0a582439516cb2f45e9aab56589342d897288ecf29e5807a82dbdd
|
|
| MD5 |
18772387079eaeccfabaab81e8d577b4
|
|
| BLAKE2b-256 |
d43d6bf56451d48384b98f5e8e3c3608950348fe08bf897f824f8a6011d4cbb4
|
Provenance
The following attestation bundles were made for servo_fetch-0.10.0-cp310-abi3-manylinux_2_28_x86_64.whl:
Publisher:
release-python.yml on konippi/servo-fetch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
servo_fetch-0.10.0-cp310-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
9738e4c33a0a582439516cb2f45e9aab56589342d897288ecf29e5807a82dbdd - Sigstore transparency entry: 1548400652
- Sigstore integration time:
-
Permalink:
konippi/servo-fetch@4dfe2efe8718985a216f221fdc3817d3e60d7e2c -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/konippi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@4dfe2efe8718985a216f221fdc3817d3e60d7e2c -
Trigger Event:
push
-
Statement type:
File details
Details for the file servo_fetch-0.10.0-cp310-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: servo_fetch-0.10.0-cp310-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 36.6 MB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7f1def96bf5b6c41a5d952736d140e2e37ba555af10972688b68f9826913ceb
|
|
| MD5 |
57223385ec1bb32d79844a1dd7f8d4a1
|
|
| BLAKE2b-256 |
a8c521618897138a4bbb8b69d8d6beccc3da7219352803c88ad1ef59128d4629
|
Provenance
The following attestation bundles were made for servo_fetch-0.10.0-cp310-abi3-manylinux_2_28_aarch64.whl:
Publisher:
release-python.yml on konippi/servo-fetch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
servo_fetch-0.10.0-cp310-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
b7f1def96bf5b6c41a5d952736d140e2e37ba555af10972688b68f9826913ceb - Sigstore transparency entry: 1548400671
- Sigstore integration time:
-
Permalink:
konippi/servo-fetch@4dfe2efe8718985a216f221fdc3817d3e60d7e2c -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/konippi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@4dfe2efe8718985a216f221fdc3817d3e60d7e2c -
Trigger Event:
push
-
Statement type:
File details
Details for the file servo_fetch-0.10.0-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: servo_fetch-0.10.0-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 32.1 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
501816b552450a48e02cc374fe2ac6c470d6f9b6b9141df763ebbda267fa36b7
|
|
| MD5 |
97124337087aca7a3934099bf931a766
|
|
| BLAKE2b-256 |
9df95916165d223893e8bfe294b423e181b35224273285b9c2bda1b3beff34a8
|
Provenance
The following attestation bundles were made for servo_fetch-0.10.0-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
release-python.yml on konippi/servo-fetch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
servo_fetch-0.10.0-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
501816b552450a48e02cc374fe2ac6c470d6f9b6b9141df763ebbda267fa36b7 - Sigstore transparency entry: 1548400689
- Sigstore integration time:
-
Permalink:
konippi/servo-fetch@4dfe2efe8718985a216f221fdc3817d3e60d7e2c -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/konippi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@4dfe2efe8718985a216f221fdc3817d3e60d7e2c -
Trigger Event:
push
-
Statement type:
File details
Details for the file servo_fetch-0.10.0-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: servo_fetch-0.10.0-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 33.9 MB
- Tags: CPython 3.10+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a6ded3c6548a3b71b78b978509bf8919b8a0ba34e10c2fe136e55cc74388f44
|
|
| MD5 |
e36ee6f529ba9a7cad5fe1e860beab97
|
|
| BLAKE2b-256 |
2166272dc562e88d5601ad7a1376959608faac724a662ef29da12517f90090bf
|
Provenance
The following attestation bundles were made for servo_fetch-0.10.0-cp310-abi3-macosx_10_12_x86_64.whl:
Publisher:
release-python.yml on konippi/servo-fetch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
servo_fetch-0.10.0-cp310-abi3-macosx_10_12_x86_64.whl -
Subject digest:
6a6ded3c6548a3b71b78b978509bf8919b8a0ba34e10c2fe136e55cc74388f44 - Sigstore transparency entry: 1548400636
- Sigstore integration time:
-
Permalink:
konippi/servo-fetch@4dfe2efe8718985a216f221fdc3817d3e60d7e2c -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/konippi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@4dfe2efe8718985a216f221fdc3817d3e60d7e2c -
Trigger Event:
push
-
Statement type: