WebVac is an asyncio-powered dynamic web scraping and crawling tool built for modern JavaScript-heavy targets. It drives a real Chromium browser through Patchright, supports proxy rotation, robots handling, anti-bot resilience, optional login/session reuse, and exports rich scan artifacts in multiple formats.
- Dynamic scraping with a real browser engine (Patchright)
- Single-page and recursive crawl modes
- Concurrency support with isolated browser slot identities
- Proxy pools with latency-based selection, round-robin, or random strategy
- robots.txt support with optional crawl-delay override
- Cloudflare-origin bypass helpers (manual origin IP and CF-Hero integration)
- Automatic screenshots for blocked/CAPTCHA pages
- Structured output in JSON, CSV, HTML, Markdown, SQLite, or all formats
- Historical scan sessions and diff generation between runs
- PDF and sourcemap asset download support
- Unified auth: Patchright login, session restore, MFA/TOTP, OAuth bootstrap
- Mid-crawl auth-wall handling, logout URL deny, and sticky proxy when authenticated
- Optional VAPT/recon pipeline present in codebase (disabled by default)
All application code lives in the installable webvac/ package. See docs/STRUCTURE.md.
run.py: Thin shim → interactive menu (webvac.cli.interactive)webvac/cli/scraper.py: Main CLI orchestrator (python -m webvac)webvac/core/: BFS crawler, page scrape flow, pipelines, VAPT runnerwebvac/auth/: AuthManager, sessions, MFA, auth-wall detectionwebvac/utils/: Browser, proxies, robots, CF-Hero, screenshotswebvac/data/: HTML parse, page records, storage/exportwebvac/collectors|analyzers|findings|active/: Optional VAPT stack (default off)examples/: Input templates (auth, proxies, session, pipeline) — seeexamples/README.mddocs/,tests/,scripts/
- Python 3.11+ (3.12 recommended)
- Windows, Linux, or macOS
- Browser dependencies required by Patchright
- Clone the repository.
- Create and activate a virtual environment.
- Install dependencies.
python -m venv .venv
(Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned) ; (& .\.venv\Scripts\Activate.ps1)
pip install -r requirements.txt
pip install -e .python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .pip install -e . registers the webvac and webvac-menu console scripts and makes imports resolve as webvac.*.
Templates live under examples/. Copy and edit before use:
| Template | Flag |
|---|---|
examples/auth_creds.example.json |
--auth-profile / login JSON |
examples/proxies.example.txt |
--proxy-file |
examples/session.example.json |
--session-file (storage_state) |
examples/session_cookies_legacy.example.json |
--session-file (cookie list) |
examples/pipeline.example.py |
--pipeline-file |
The interactive menu (python run.py) lists these files and shows format hints when you pick session / proxy / credentials / pipeline.
python run.py
# or: webvac-menuThe launcher helps you choose scrape mode, output formats, robots strategy, proxy mode, and browser visibility.
python -m webvac --url https://example.com --mode singlepython -m webvac --url https://example.com --mode crawl --depth 3 --max-pages 50 --concurrency 2--url: Target URL (required)--mode single|crawl: Single page or recursive internal crawl--engine dynamic|lightweight: Browser-based or lightweight HTTP engine--depth: Maximum crawl depth (crawl mode)--max-pages: Maximum number of pages (omit for unlimited crawl)--concurrency: Parallel workers for crawl mode
--no-headless: Run browser in visible mode--timeout: Page load timeout in milliseconds--wait-until domcontentloaded|load|networkidle: Navigation wait strategy
--output: Output root directory (default:scraped_data)--format:json,csv,markdown,sqlite,html,all--label: Custom label for output naming
--no-robots: Ignore robots.txt entirely--ignore-crawl-delay: Obey allow/deny rules but ignore crawl-delay--delay-min,--delay-max: Request pacing window
--login: Enable login before scraping (forcesdynamicengine)--login-url: Login page URL--username,--password: Credentials (or setWEBVAC_USER/WEBVAC_PASS)--session-file: Load/save Playwrightstorage_state(legacy cookie-list files still work)--auth-profile FILE: Rich credentials JSON (selectors, steps, TOTP, policies) — seeexamples/auth_creds.example.json--auth-check-url URL: Protected URL used to verify session after login/restore--on-auth-wall abort|skip|relogin: Mid-crawl login-wall policy (default:skip)--session-ttl SECONDS: Expire saved sessions (0 = never)--auth-bootstrap: Open a visible browser for manual OAuth/SSO, then export--session-file--otp-prompt: Prompt for OTP/MFA when an OTP field appears--no-auth-proxy-rotate: Pin proxy while authenticated (also default when--login)--dismiss-selector CSS: Extra Accept-button selector (repeatable; login + every scrape)--pause-for-consent: Headed wait-for-ENTER after first page per host (use with--no-headless)--no-consent-dismiss: Disable automatic cookie/CMP Accept clicks on scraped pages
Known-site CMP URL bypasses (applied automatically when the host matches): e.g. Deloitte gets ?hidebanner=true. Google/YouTube get a CONSENT=YES+ cookie before navigation. Not applied to unknown sites.
Honeypot links (display:none, visibility:hidden, common hidden classes) are skipped when discovering crawl links.
Env vars: WEBVAC_USER, WEBVAC_PASS, optional WEBVAC_SESSION_KEY (Fernet-encrypt session files).
Example — login then crawl:
python -m webvac --url https://example.com/dashboard --mode crawl \
--login --login-url https://example.com/login \
--username you@example.com --password secret \
--session-file sessions/example.json \
--auth-check-url https://example.com/account \
--on-auth-wall skipExample — restore session only:
python -m webvac --url https://example.com/dashboard --mode single \
--session-file sessions/example.json --auth-check-url https://example.com/account--proxy-file FILE: One proxy per line--proxies "...": Comma-separated proxy list--proxy-strategy latency|random|round_robin--sticky-requests N: Requests before voluntary rotate--cooldown-seconds SECS: Cooldown after 429/timeout--no-health-check: Skip startup benchmark
Requires CF-Hero on PATH (go install -v github.com/musana/cf-hero/cmd/cf-hero@latest).
--origin-ip IP: Scrape using origin IP + Host header--cf-hero: Discover origin IP via CF-Hero first (uses-ftempfile — correct CF-Hero CLI)--cf-hero-bin PATH: Explicit CF-Hero executable path--cf-hero-args "...": Extra flags (e.g."-shodan -censys -securitytrails -zoomeye")--cf-hero-timeout SECS: CF-Hero process timeout (default 300)--cf-hero-workers N: CF-Hero-wworker count--cf-hero-quiet: Omit CF-Hero-v--cf-hero-log FILE: Save raw CF-Hero output--origin-title TITLE: Expected title for validation (also passed as CF-Hero-title)--skip-origin-validate: Use discovered/manual IP without title check--no-cf-hero-auto: Disable mid-crawl auto discovery on bot/WAF blocks
See docs/architecture/CF_HERO.md.
Use either of the following per line:
http://ip:porthttp://ip:port|username|password
Lines beginning with # are treated as comments.
Example:
# plain
http://1.2.3.4:8080
# authenticated
http://5.6.7.8:3128|myuser|mypassword
WebVac writes data under scraped_data using scan-session folders for versioned runs.
scraped_data/
<target>/
scans/
<timestamp>_<scan-id>/
scrape/
data.json
data.csv
report.html
assets/
pdfs/
sourcemaps/
screenshots/
meta/
meta.json
session.json
diffs/
...
docs/ARCHITECTURE.md— Full system architecture (layers, sequence, status matrix)docs/architecture/AUTH.md— Authentication / sessions / MFA / auth-wallsdocs/architecture/CRAWL.md— Crawler, page flow, browser pooldocs/architecture/DATA.md— Parsing, page records, storage layoutdocs/architecture/PROXY_ORIGIN.md— Proxies, robots, CF-Hero / origindocs/architecture/CF_HERO.md— Complete CF-Hero CLI + validation flowdocs/architecture/VAPT.md— Optional collectors → analyzers → findingsdocs/CHANGES_AND_IMPROVEMENTS.md— Recent changes + improvement ideasdocs/webvac-architecture-one-page.html— One-page visual architecture
To regenerate architecture PDF:
python scripts/generate_architecture_pdf.pyRun tests from project root:
python -m unittest discover -s tests -p "test_*.py"- Respect target terms of service and legal boundaries.
- Use
--no-robotsonly when you are explicitly authorized. - Avoid scraping sensitive targets without permission.
- Store credentials and proxy secrets securely — copy
examples/auth_creds.example.jsontoauth_creds.json(gitignored). - Prefer env vars (
WEBVAC_USER/WEBVAC_PASS) over committing credentials. - Optional session encryption: set
WEBVAC_SESSION_KEYbefore saving sessions.
- Scrape pipeline is enabled.
- VAPT/recon modules exist but are disabled by default in configuration.
- Default output formats are
json,csv,html.
- Ensure dependencies are installed in the active virtual environment.
- Try visible browser mode with
--no-headless. - Switch wait strategy to
--wait-until domcontentloaded.
- Enable proxies and use latency strategy.
- Lower concurrency.
- Increase delays between requests.
- Use origin mode only when authorized.
- Increase timeout.
- Crawl deeper with higher
--depth. - Verify selectors if using targeted extraction options.
- Adityaaa — author & maintainer
- Create a feature branch.
- Keep changes focused and test locally.
- Add or update tests where relevant.
- Open a pull request with a concise summary.
Add your preferred license file and update this section accordingly.