13 min

AdsCrawl Tutorial: Screenshots, HTML Extraction & Remote CDP

Step-by-step AdsCrawl tutorial: capture screenshots, extract HTML/Markdown, and control remote CDP sessions for web scraping and automation.

AAnonymous

AdsCrawl Tutorial: Screenshots, HTML Extraction & Remote CDP

AdsCrawl provides a powerful browser automation and data extraction API that runs real cloud browser sessions. Whether you need full-page screenshots, clean HTML or Markdown content, or full remote control via the Chrome DevTools Protocol, this tutorial will walk you through the essential steps. By the end, you’ll know how to set up your account, make your first API call, and configure anti‑detect browser environments for reliable scraping, monitoring, and AI data pipelines.

Prerequisites

AdsCrawl Tutorial: Screenshots, HTML Extraction & Remote CDP product interface and feature overview

AdsCrawl Tutorial: Screenshots, HTML Extraction & Remote CDP product interface and feature overview.

Before you start, make sure you have:

  • An AdsCrawl account (sign up for free to access the API)
  • Your API key from the AdsCrawl dashboard
  • Familiarity with REST APIs and basic scripting (Python or curl examples will be used)

Step 1: Creating an Account and Obtaining Your API Key

AdsCrawl Tutorial: Screenshots, HTML Extraction & Remote CDP product interface and feature overview

AdsCrawl Tutorial: Screenshots, HTML Extraction & Remote CDP product interface and feature overview.

Head over to the AdsCrawl official site and click “Sign Up”. After verifying your email, log in to the dashboard. You’ll find your unique API key under the “API Keys” section. Copy it—you’ll include it as a Bearer token in every request.

Step 2: Your First Screenshot – A Simple API Request

AdsCrawl Tutorial: Screenshots, HTML Extraction & Remote CDP product interface and feature overview

AdsCrawl Tutorial: Screenshots, HTML Extraction & Remote CDP product interface and feature overview.

AdsCrawl exposes a dedicated endpoint for capturing full‑page or viewport screenshots. Let’s take a snapshot of example.com.

Endpoint: POST https://api.adscrawl.net/v1/screenshot

Headers:

  • Authorization: Bearer YOUR_API_KEY
  • Content-Type: application/json

Request body:

{
  "url": "https://example.com",
  "format": "png"
}

Using curl:

curl -X POST https://api.adscrawl.net/v1/screenshot \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "format": "png"}'

The response includes a screenshot_url field containing a temporary link to the rendered PNG image. You can also receive the image as a base64‑encoded string by adding "encoding": "base64" to the request body.

Python example:

import requests

api_url = "https://api.adscrawl.net/v1/screenshot"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
payload = {"url": "https://example.com", "format": "png"}

response = requests.post(api_url, json=payload, headers=headers)
print(response.json()["screenshot_url"])

Step 3: Extracting HTML and Markdown Content

AdsCrawl Tutorial: Screenshots, HTML Extraction & Remote CDP product interface and feature overview

AdsCrawl Tutorial: Screenshots, HTML Extraction & Remote CDP product interface and feature overview.

For data collection and AI enrichment, AdsCrawl can extract the raw HTML or a clean Markdown version of a page. Use the /scrape endpoint.

Endpoint: POST https://api.adscrawl.net/v1/scrape

Example request (Markdown extraction):

{
  "url": "https://example.com",
  "output_type": "markdown"
}

Response snippet:

{
  "content": "# Example Domain\nThis domain is for use in illustrative examples...",
  "status_code": 200
}

You can also set "output_type": "html" to get the full page source, or "output_type": "text" for plain text. For a deeper dive into all supported endpoints, refer to the AdsCrawl API documentation guide.

Step 4: Interactive Browser Control with Remote CDP

When you need to interact with a page—logging in, clicking buttons, scrolling—AdsCrawl lets you launch a remote Chrome DevTools Protocol (CDP) session. This is ideal for dynamic content that only loads after user actions.

Endpoint: POST https://api.adscrawl.net/v1/browser

This returns a WebSocket URL (ws://...) that you can connect to with libraries like Puppeteer or Playwright.

Minimal Python example using websocket-client:

import requests
import websocket

api_url = "https://api.adscrawl.net/v1/browser"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
resp = requests.post(api_url, headers=headers, json={"url": "https://example.com"})
ws_url = resp.json()["ws_endpoint"]

ws = websocket.WebSocket()
ws.connect(ws_url)
# Send CDP commands to navigate, evaluate JavaScript, etc.
ws.send('{"id":1,"method":"Page.navigate","params":{"url":"https://example.com"}}')
# Receive responses...

Inside the remote session, you can handle complex flows while AdsCrawl manages the browser infrastructure, fingerprint, and network isolation.

Step 5: Configuring Fingerprint and Browser Environments

A standout feature of AdsCrawl is its integration with AdsPower’s fingerprint browser core. You can define realistic device fingerprints—user agent, timezone, WebGL renderer, screen resolution, and more—to avoid detection and bans.

When creating a screenshot or CDP session, include a fingerprint_profile object:

{
  "url": "https://example.com",
  "fingerprint_profile": {
    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ...",
    "timezone": "America/New_York",
    "webgl_vendor": "Google Inc. (Intel)"
  }
}

Pre‑configured profiles can be stored in your AdsPower account and referenced by ID. For a complete walkthrough of every setting, see our AdsCrawl fingerprint settings guide.

Step 6: Managing Concurrent Sessions and Rate Limits

AdsCrawl supports multiple parallel sessions, making it suitable for bulk scraping and monitoring. The number of concurrent sessions allowed depends on your subscription plan. The free tier gives you a taste of the service, while paid plans unlock higher concurrency and priority routing.

When scaling, always watch for HTTP 429 (Too Many Requests) and implement exponential backoff. For cost details and plan comparisons, check the AdsCrawl pricing guide.

Step 7: Error Handling and Best Practices

Here are a few tips to keep your automations robust:

  • Retry on transient errors – If you receive a 5xx or 429, wait a few seconds and try again.
  • Store cookies between sessions – For authenticated scraping, save cookies returned by the CDP session and re‑inject them to avoid repeated logins.
  • Rotate fingerprints – When crawling the same site at scale, cycle through multiple fingerprint profiles to reduce pattern detection.
  • Use the /health endpoint – Monitor API availability before launching a large job.

Related reading

Sources and further reading

FAQ

What is AdsCrawl?

AdsCrawl is a browser automation and data extraction API that runs real cloud browser sessions. It captures screenshots, extracts structured content (HTML, Markdown, text), and provides full remote CDP control, all integrated with anti‑detect fingerprint technology.

Is there a free trial?

Yes. The free tier includes a limited number of API calls per month, perfect for testing and small projects. For higher volumes, scalable pricing plans are available.

Can AdsCrawl handle websites that require login?

Absolutely. Use the remote CDP session to navigate to the login page, fill in credentials, and solve CAPTCHAs if needed. Once authenticated, you can reuse session cookies for subsequent requests.

What fingerprint configurations are supported?

You can customize user agent, timezone, WebGL parameters, screen resolution, language, and many other browser attributes. Pre‑built fingerprint profiles from AdsPower can be referenced directly in your API calls.

How fast are the responses?

Average API response time is around 50 ms for the control plane, while actual rendering time depends on the target page. AdsCrawl’s global node infrastructure ensures low latency for most regions.

Conclusion

AdsCrawl turns complex browser automation into a simple, composable API. In this tutorial you learned how to capture screenshots, extract clean content, launch interactive CDP sessions, and configure undetectable browser fingerprints. Whether you’re building a price monitor, an SEO audit tool, or feeding an AI data pipeline, AdsCrawl provides the real‑browser infrastructure without the Ops headache.

For more in‑depth automation and scraping resources, explore other guides on AdsCrawl.