🇨🇳 中文版
Quick start examples for Lexmount Python SDK.
- Visit Lexmount website
- Verify page title
- Take screenshot
- Use
chrome-light-dockermode - Visit Sina News
- Extract all links and save to
links.txt
- Upload
test_extension.zip - List uploaded extensions
- Create a browser session with
extension_ids
- Create a browser session with
proxy - Verify the remote browser can use authenticated upstream proxy
- Create a browser session
- Print the
inspect_urlfor manual inspection - Wait for user input before closing the session
- Create a browser session
- Query
/jsontargets through the SDK - Print each target's
inspectUrl, page URL, and websocket URL
- Uses
lexmount==0.5.1 - Query the public endpoint catalog through
client.catalog_info() - Print available regions, host, and endpoint IPs
- Accept an existing source
context_id - Fork it into a new context
- Print the forked context id
- Build a direct websocket URL from
LEXMOUNT_BASE_URL - Connect through
/connection?project_id=...&api_key=... - Visit
https://example.comand saveconnection_demo.png
- Explicitly configure
Browser.setDownloadBehaviorto/config/Downloads - Trigger a file download in the remote browser
- Query the session downloads list via SDK
- Fetch the session downloads zip via SDK
# 1. Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate # Linux/macOS or venv\Scripts\activate (Windows)
# 2. Install dependencies
pip install -r requirements.txt
# 3. Create .env file
cp .env.example .env
# Edit .env and fill in your actual API Key and Project ID
# For office test environment:
# LEXMOUNT_BASE_URL=https://apitest.local.lexmount.net
# 4. Run examples
python3 demo.py # Basic demo
python3 light_demo.py # Light browser demo
python3 context_fork.py <context_id> # Context fork demo
python3 extension_basic.py # Extension demo
python3 proxy_demo.py # Proxy demo
python3 inspect_url_demo.py # Inspect URL demo
python3 session_targets.py # Session targets demo
python3 catalog_info.py # Public endpoint catalog demo
python3 connection_demo.py # Direct connection demo
python3 session_downloads.py # Session downloads demo