Skip to main content

dawg-sdk-python

Python SDK for BaaS (Browser as a Service).

Two tools in one SDK:

  • Baas — cloud browser via CDP WebSocket (Playwright, Puppeteer, Selenium)
  • Scraper — fast HTTP scraping with content extraction (no browser needed)

Installation

pip install dawg-sdk-python

Scraper — HTTP scraping

Extract clean content from web pages without a browser. Fast, cheap, TLS-fingerprinted.

from dawg_sdk import Scraper

with Scraper(api_key="your_key") as s:
    # Single page → markdown
    result = s.scrape("https://example.com")
    print(result.content)

    # Crawl a site
    job = s.crawl("https://example.com", max_depth=2, max_pages=20)
    job.wait()
    for page in job.pages:
        print(page.url, len(page.content))

    # Batch scrape
    job = s.batch(["https://a.com", "https://b.com"])
    job.wait()

Scraper Methods

  • scrape(url, format="markdown", main_content=False, include_links=False) → ScrapeResult
  • crawl(url, max_depth=2, max_pages=50, concurrency=3) → ScrapeJob
  • batch(urls, concurrency=5) → ScrapeJob
  • get_job(job_id) → ScrapeJob
  • cancel_job(job_id)

Formats: "markdown", "text", "html"

Jobs (crawl/batch) are async — use job.wait() to block until done, or job.refresh() to poll manually.

Browser — CDP access

Get a cloud browser via WebSocket. Use with any automation framework.

from dawg_sdk import Baas

with Baas(api_key="your_key") as ws_url:
    browser = playwright.chromium.connect_over_cdp(ws_url)
    # ... your code ...
# auto-released

With Proxy

baas = Baas(api_key="your_key")
ws_url = baas.create(proxy="socks5://user:pass@host:port")

Async

from dawg_sdk import AsyncBaas

async with AsyncBaas(api_key="your_key") as ws_url:
    browser = await playwright.chromium.connect_over_cdp(ws_url)

Browser Methods

  • create(proxy=None, geo=None) -> str — returns ws_url
  • release() — release browser back to pool
  • close() — close HTTP session

Exceptions

from dawg_sdk import BaasError, AuthError, RateLimitError

try:
    result = scraper.scrape("https://example.com")
except AuthError:
    print("Invalid API key")
except RateLimitError as e:
    print(f"Rate limit, retry after {e.retry_after}s")

Examples

Scrape to markdown

from dawg_sdk import Scraper

s = Scraper(api_key="your_key")
result = s.scrape("https://news.ycombinator.com", format="markdown", main_content=True)
print(result.metadata["title"])
print(result.content)
s.close()

Playwright browser

from playwright.sync_api import sync_playwright
from dawg_sdk import Baas

with Baas(api_key="your_key") as ws_url:
    with sync_playwright() as p:
        browser = p.chromium.connect_over_cdp(ws_url)
        page = browser.contexts[0].pages[0]
        page.goto("https://example.com")
        print(page.title())
        browser.close()

License

MIT

Metadata

Release files for dawg-sdk-python 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dawg-sdk-python 0.4.0
File Size Uploaded Provenance Actions
dawg_sdk_python-0.4.0.tar.gz 8.9 kB Without provenance Details for dawg_sdk_python-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dawg-sdk-python 0.4.0
File Interpreter ABI Platform Actions
dawg_sdk_python-0.4.0-py3-none-any.whl Python 3 none any Details for dawg_sdk_python-0.4.0-py3-none-any.whl

Total release size: 20.0 kB

Release files / dawg_sdk_python-0.4.0.tar.gz

Download URL dawg_sdk_python-0.4.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ee096faaf74eb21ab8e9815fe094474340ffd8b32e28034df273f2b3f5b8b9da
BLAKE2b-256 checksum
How to use checksums
173a097eed189139cf3abba4851c992a19bd5d0d972d871b730c4251f0774571
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / dawg_sdk_python-0.4.0-py3-none-any.whl

Download URL dawg_sdk_python-0.4.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43f029103193ab54a0e08fd6ef72710297fbd178b6c16b7ffd11618d78dad30f
BLAKE2b-256 checksum
How to use checksums
19acf269d6844832c8bf2b802b95c36f483720c03274b24f70193306c0c2b869
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for dawg-sdk-python 0.4.0

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.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page