Headless Chrome service for PentAGI: page HTML, Markdown, links, screenshots, PDF and live sessions
100K+
⠀
Join the community. Connect with security researchers, AI enthusiasts, and fellow ethical hackers. Get support, share insights, and stay updated with the latest PentAGI developments.
Headless Chrome behind one HTTPS port: page HTML, Markdown, links, screenshots and PDF, plus interactive browser sessions
The browser that PentAGI agents use to read the web. One container, TLS and Basic Auth included, built for linux/amd64 and linux/arm64.
# Start the service on https://localhost:9443
docker run -d --name scraper -p 9443:443 --shm-size=2g \
-v scraper-ssl:/usr/src/app/ssl \
-e USERNAME=someuser -e PASSWORD=somepass \
vxcontrol/scraper
# Check it: the page as Markdown
curl -k -u someuser:somepass "https://localhost:9443/markdown?url=https://example.com/"
# A screenshot of the whole page
curl -k -u someuser:somepass -o page.png \
"https://localhost:9443/screenshot?fullPage=true&url=https://example.com/"
curl -k. The volume keeps it between restarts.USERNAME and PASSWORD the API answers without authentication.| Tag | Build | API |
|---|---|---|
latest, 2 | Current build | Scraper API (v1) and Session API (v2) |
1 | Previous, legacy build | Scraper API (v1) only |
2 keeps the Scraper API of 1 unchanged: a client written for 1 works with 2 as it is. Stay on 1 only if you need the previous build exactly:
docker pull vxcontrol/scraper:1
1, 2, latestEvery call opens the page in a browser of its own, renders it and closes the browser. All routes are GET and take the page address in url.
| Route | Answer |
|---|---|
/html?url=... | Rendered HTML of the page, text/html |
/markdown?url=... | The page as Markdown, text/markdown |
/links?url=... | Links of the page, JSON: [{"title": "...", "link": "..."}] |
/screenshot?url=...&fullPage=true&type=png | Screenshot, image/png or image/jpeg (type=jpeg) |
/pdf?url=... | The page as PDF, application/pdf |
In 2 the same routes also answer under /v1, for example /v1/markdown?url=.... A call in 2 is bounded: 55 seconds and SCRAPER_MAX_RESPONSE_BYTES of answer.
2, latestcurl -k -u someuser:somepass https://localhost:9443/version
# {"api":{"scraper":true,"sessions":true},"name":"browserx","version":"..."}
1 has no such route and answers 404, so a client can tell the two builds apart.
2, latestA session is a Chrome that stays open: tabs, clicks and typing, files, cookies, the network log and a live view. All routes start with /v2.
| Route | Purpose |
|---|---|
GET /v2/capabilities | What this service can do and its limits |
POST /v2/sessions, GET /v2/sessions | Open a session, list sessions |
GET, DELETE /v2/sessions/{id} | Read or close a session |
GET, POST /v2/sessions/{id}/tabs | List tabs, open a tab |
POST .../tabs/{tabId}/activate, DELETE .../tabs/{tabId} | Bring a tab to the front, close it |
POST .../tabs/{tabId}/navigate | Open an address in the tab |
POST .../tabs/{tabId}/action | click, fill, type, press, select, scroll, wait, dialog, upload, back, forward, reload |
GET .../tabs/{tabId}/snapshot | Elements and text of the page, with references for actions |
GET .../tabs/{tabId}/read?format=text | The page as text, html or links |
POST .../tabs/{tabId}/find, GET .../tabs/{tabId}/frames | Find elements by text, list frames |
GET .../tabs/{tabId}/screenshot | Screenshot as base64 PNG or JPEG |
GET, DELETE .../tabs/{tabId}/network, .../console | Network log and console of the tab |
GET, POST, DELETE .../tabs/{tabId}/cookies, .../storage/local, .../storage/session | Cookies and storage |
POST .../tabs/{tabId}/evaluate | Run JavaScript in the page (BROWSERX_ALLOW_EVALUATE) |
POST /v2/sessions/{id}/uploads, GET /v2/sessions/{id}/downloads | Files for upload fields, files the pages downloaded |
WS /v2/sessions/{id}/stream?tabId=... | Live view of a tab and input into it |
... stands for /v2/sessions/{id}.
BASE=https://localhost:9443
AUTH=someuser:somepass
# Open a session: the answer has "id" and "activeTabId"
curl -k -u $AUTH -X POST -H 'Content-Type: application/json' -d '{}' $BASE/v2/sessions
# Open a page in its tab, read the text, close the session
curl -k -u $AUTH -X POST -H 'Content-Type: application/json' \
-d '{"url":"https://example.com/"}' $BASE/v2/sessions/<id>/tabs/<tabId>/navigate
curl -k -u $AUTH "$BASE/v2/sessions/<id>/tabs/<tabId>/read?format=text"
curl -k -u $AUTH -X DELETE $BASE/v2/sessions/<id>
A session does not open addresses of the container itself (localhost and other loopback addresses).
| Variable | Default | Meaning |
|---|---|---|
USERNAME, PASSWORD | not set | Basic Auth of the API. Not set: no authentication |
MAX_CONCURRENT_SESSIONS | 10 | Browsers that run at the same time |
USE_SSL | true | Serve HTTPS |
SERVER_NAME | scraper.local in 1, browserx.local in 2 | Name in the generated certificate |
LISTEN | 0.0.0.0:443 | Address and port inside the container |
CONNECTION_TIMEOUT | 60000 in 1, 86400000 in 2 | Milliseconds a browser connection may live |
To use your own certificate, put service.crt and service.key into /usr/src/app/ssl before the first start.
2, latest| Variable | Default | Meaning |
|---|---|---|
SESSION_MANAGER_URL | inside the container | Set it empty to run the Scraper API alone, without /v2 |
SCRAPER_MAX_RESPONSE_BYTES | 64 MiB | Largest answer of a Scraper API call |
BROWSERX_MAX_SESSIONS | 8 | Sessions open at the same time |
BROWSERX_SESSION_IDLE_TIMEOUT_MS | 600000 | A session nobody uses for this long is closed |
BROWSERX_MAX_TABS | 50 | Tabs in one session |
BROWSERX_STEP_TIMEOUT_MS | 15000 | Longest single step in a tab; 0 lifts the bound |
BROWSERX_ALLOW_EVALUATE | true | Allow evaluate |
BROWSERX_ACCEPT_INSECURE_CERTS | true | Open pages with self-signed or expired certificates |
BROWSERX_DOWNLOAD_MAX_BYTES, BROWSERX_DOWNLOADS_MAX_BYTES | 100 MiB, 500 MiB | Largest download, and all downloads kept in one session |
BROWSERX_UPLOADS_MAX_BYTES | 500 MiB | Files uploaded in one session |
BROWSERX_NETWORK_JOURNAL_BYTES | 100 MiB | Memory of the network log of one session |
services:
scraper:
image: vxcontrol/scraper:latest
restart: unless-stopped
shm_size: 2g
ports:
- 127.0.0.1:9443:443
environment:
- MAX_CONCURRENT_SESSIONS=10
- USERNAME=someuser
- PASSWORD=somepass
volumes:
- scraper-ssl:/usr/src/app/ssl
volumes:
scraper-ssl:
2 reports its health to Docker (HEALTHCHECK) and stops when one of the Scraper API processes ends, so keep a restart policy.
Content type
Image
Digest
sha256:e975ce425…
Size
1.3 GB
Last updated
1 day ago
docker pull vxcontrol/scraper