scitex-browser
Playwright wrappers for scholarly paper access — popup handling, PDF capture, failure-replay screenshots, stealth browsing.
Full Documentation · uv pip install scitex-browser[all]
Problem and Solution
| # | Problem | Solution |
|---|---|---|
| 1 | Playwright is great but verbose -- every scraping script reinvents popup dismissal, retry logic, Chrome-PDF-viewer workaround | Helpers: click_with_fallbacks_async([sel1, sel2]), save_as_pdf_async, close_popups_async, inject_visual_effects — focused wrappers around Playwright |
| 2 | Tests fail silently with no artifact -- pytest-playwright doesn't auto-capture screen + DOM on failure |
TestMonitor + create_failure_capture_fixture -- captures screenshot + page HTML + console log on every failure |
Features
- Debugging: Visual cursor feedback, popup logging, failure capture, test monitoring
- PDF: Chrome PDF viewer detection, save-as-PDF automation
- Content: Rendered HTML/text capture and chat thread extraction
- Interaction: Click/fill with fallbacks, popup handling
- Stealth: Human-like behavior simulation, stealth browser management
- Remote: ZenRows API integration, CAPTCHA handling
- Collaboration: Shared browser sessions, credential management
- Auth: Google authentication helpers
Installation
pip install scitex-browser
Capture rendered content
Install the browser binary with python -m playwright install chromium, then:
from scitex_browser import get_text, save_as_html
text = get_text("https://example.com")
save_as_html("https://example.com", "example.html")
The async equivalents are get_text_async and save_as_html_async. For pages
that require an existing login, pass cdp_url for a browser session you own.
Architecture
scitex-browser/
├── src/scitex_browser/
│ ├── __init__.py # save_as_pdf, click_with_fallbacks_async, ...
│ ├── _compat.py # Standalone fallback when scitex_config absent
│ ├── _state.py # Local-state path helpers (runtime/ layout)
│ ├── auth/ # Google OAuth helpers
│ ├── automation/ # CookieAutoAcceptor
│ ├── collaboration/ # SharedBrowserSession, CredentialManager
│ ├── core/ # BrowserMixin, ChromeProfileManager
│ ├── debugging/ # TestMonitor, capture_debug, visual overlays
│ ├── interaction/ # Click/fill with fallbacks, popup handling
│ ├── pdf/ # Chrome-PDF-viewer detection, save_as_pdf
│ ├── remote/ # ZenRows API + CAPTCHA handling
│ └── stealth/ # StealthManager + HumanBehavior
└── tests/ # pytest-playwright suite
Optional extras
pip install scitex-browser[dev] # pytest + scitex-dev for local development
pip install scitex-browser[docs] # Sphinx + RTD theme for doc building
pip install scitex-browser[all] # dev + docs
Quick start
from scitex_browser import save_as_pdf, browser_logger
from scitex_browser.stealth import StealthManager
1 Interfaces
Python API
from scitex_browser import (
save_as_pdf, save_as_pdf_async,
click_with_fallbacks_async, close_popups_async,
inject_visual_effects, browser_logger,
)
from scitex_browser.stealth import StealthManager
from scitex_browser.debugging import (
TestMonitor, create_failure_capture_fixture,
capture_debug_artifacts_async, # screenshot + HTML (via .debugging)
)
click_with_fallbacks_async and fill_with_fallbacks_async capture
screenshot + HTML before/after every call by default
(capture_debug=True). Drop capture_debug=False only in tight
loops. See _skills/scitex-browser/11_debugging-visuals.md for the
full pattern.
Demo
sequenceDiagram
participant T as pytest test
participant H as click_with_fallbacks_async
participant P as Playwright Page
participant C as capture_debug_artifacts_async
T->>H: click(["#accept", ".cookie-ok"])
H->>P: try selector 1
P-->>H: not found
H->>P: try selector 2 -> click
H->>C: snapshot before/after
C-->>T: screenshot.png + page.html + console.log
Part of SciTeX
scitex-browser is part of SciTeX. Install via
the umbrella with pip install scitex[browser] to use as
scitex.browser (Python) or scitex browser ... (CLI).
Four Freedoms for Research
- The freedom to run your research anywhere — your machine, your terms.
- The freedom to study how every step works — from raw data to final manuscript.
- The freedom to redistribute your workflows, not just your papers.
- The freedom to modify any module and share improvements with the community.
AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.
License
AGPL-3.0. See LICENSE for details.
Metadata
Release files for scitex-browser 0.1.17
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 | Actions |
|---|---|---|---|---|
| scitex_browser-0.1.17.tar.gz | 9.5 MB | Without provenance | Details for scitex_browser-0.1.17.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scitex_browser-0.1.17-py3-none-any.whl | Python 3 | none | any | Details for scitex_browser-0.1.17-py3-none-any.whl |
Total release size: 18.7 MB
Release files / scitex_browser-0.1.17.tar.gz
| Download URL | scitex_browser-0.1.17.tar.gz |
|---|---|
| Size | 9.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4702f96f2f2f11ce499611001bb11f1cea9044337e378890dd32db8568aa93f9
|
|
BLAKE2b-256 checksum How to use checksums |
dfa4a516440dcd00b2db963e75b388855b9a7bacbb2909b55fbce566b811f348
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / scitex_browser-0.1.17-py3-none-any.whl
| Download URL | scitex_browser-0.1.17-py3-none-any.whl |
|---|---|
| Size | 9.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a2e0b0e7353d1ac579120dbda8824aae783b3f2e5cc89c61f87454d5f8847fe8
|
|
BLAKE2b-256 checksum How to use checksums |
ec1095202959cc90600d4efcbe4844e750f1a13db72fa716f98e852d457544e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Security for scitex-browser 0.1.17
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.