Nimbryxo Studio

Use Complete Page Capture - Screenshot & PDF with Python

Capture complete full-page screenshots or PDFs of any URL list. Scrolls lazy content, waits for images and fonts, removes fixed headers and consent overlays, emulates real devices, and reports blocks and truncation instead of returning a broken image.

1. Choose the data you need

Review the published README for supported collection modes, examples, and limits. The recipe below uses the current published input definition.

2. Prepare a source-based input

This JSON contains published prefills and required-field defaults. Review every value for your task before running it; it is not a promise of successful collection.

{
  "colorScheme": "no-preference",
  "delay": 0,
  "delayAfterScrolling": 0,
  "device": "custom",
  "deviceScaleFactor": 1,
  "format": "png",
  "fullPage": true,
  "hideFixedElements": false,
  "locale": "en-US",
  "maxConcurrency": 1,
  "maxPageHeight": 0,
  "maxRetries": 0,
  "maxScrollSteps": 400,
  "navigationTimeoutSecs": 60,
  "pdfFitOnePage": false,
  "pdfLandscape": false,
  "pdfMargin": "none",
  "pdfPageSize": "web",
  "pdfPrintBackground": true,
  "quality": 85,
  "scrollStepPx": 250,
  "scrollToBottom": false,
  "urls": [
    {
      "url": "https://www.apify.com/"
    }
  ],
  "viewportHeight": 1080,
  "viewportWidth": 1280,
  "waitForFonts": true,
  "waitForImages": false,
  "waitUntil": "domcontentloaded",
  "waitUntilNetworkIdleAfterScroll": false,
  "waitUntilNetworkIdleAfterScrollTimeout": 1000
}

Download input.example.json and save your reviewed copy as input.json.

FieldTypeRequiredDescription
urlsarrayrequiredWeb pages to capture. Each item can be a URL object or a plain URL string. Bare domains such as example.com are accepted and use https.
formatstringoptionalPNG is lossless, JPEG and WebP are smaller, PDF produces a printable document. WebP conversion uses Pillow after the browser capture.
qualityintegeroptionalQuality for JPEG and WebP output (1-100). Ignored for PNG and PDF.
fullPagebooleanoptionalCapture the full scrollable page. Turn off to capture only the visible viewport. A selector overrides this option.
selectorstringoptionalOptional CSS selector. When set, captures only that element and ignores fullPage. Example: main, #pricing, article.
devicestringoptionalDevice preset. Custom uses the viewport width, height and scale factor below. Presets emulate a real mobile or desktop browser.
viewportWidthintegeroptionalBrowser viewport width in pixels when Device is Custom.
viewportHeightintegeroptionalBrowser viewport height in pixels when Device is Custom.
deviceScaleFactorintegeroptionalPixel density for Device=Custom: 1 is standard, 2 is retina, 3 is high-DPI mobile. Device presets use their own scale factor.
colorSchemestringoptionalRequest the site's light or dark theme through prefers-color-scheme where the site supports it.
localestringoptionalLocale used for navigator.language and localized pages.
waitUntilstringoptionalNavigation readiness. DOM content loaded is the fastest reliable default; network idle can stall on analytics-heavy sites.
waitForSelectorstringoptionalOptional CSS selector to wait for before capture. Useful for single-page apps. Fails the URL if the element never becomes visible.
waitForImagesbooleanoptionalWait up to 5 seconds for images to finish loading after scrolling. Incomplete images are reported in warnings.
waitForFontsbooleanoptionalWait up to 5 seconds for web fonts to finish loading.
delayintegeroptionalAdditional milliseconds to wait after navigation before scrolling or capturing.
scrollToBottombooleanoptionalScroll through the page in steps to trigger lazy images, infinite-scroll widgets and content-visibility sections before capture.
maxScrollStepsintegeroptionalStop after this many scroll steps. Prevents infinite-scroll pages from running forever. A cap hit sets truncated=true in the record.
scrollStepPxintegeroptionalPixels to scroll per step. Smaller steps trigger more IntersectionObserver content but take longer.
delayAfterScrollingintegeroptionalMilliseconds to wait after scrolling and before capture. Only used when scrolling is enabled.
waitUntilNetworkIdleAfterScrollbooleanoptionalAfter scrolling, wait until the network is idle before capture. Uses the timeout below.
waitUntilNetworkIdleAfterScrollTimeoutintegeroptionalMaximum milliseconds to wait for network idle after scrolling.
hideFixedElementsbooleanoptionalHide real fixed headers, full-screen overlays and chat widgets before capture. Sticky content blocks are left in place. Default off because resetting to the top already prevents repeated headers on most pages.
cookieBannerActionstringoptionalHide common cookie and consent overlays, click Accept first, or leave them untouched.
selectorsToHidestringoptionalComma or newline separated CSS selectors for extra elements to hide before capture. Example: .newsletter-popup, #chat-widget
pdfPageSizestringoptionalPaper size for PDF output. Web page width preserves the previous 1280 px wide / Letter-height behavior.
pdfLandscapebooleanoptionalUse landscape orientation for PDF pages.
pdfPrintBackgroundbooleanoptionalInclude CSS backgrounds, colors and images in the PDF.
pdfFitOnePagebooleanoptionalCreate one tall PDF page instead of paginated paper. Overrides the paper height but keeps the selected margins.
pdfMarginstringoptionalPage margins for PDF output.
maxConcurrencyintegeroptionalHow many URLs to capture in parallel. Keep at 1 for long pages at 2048 MB; higher values need more memory.
maxRetriesintegeroptionalRetry transient navigation failures and block pages. Retries use the AUTO datacenter proxy when no user proxy is configured.
navigationTimeoutSecsintegeroptionalMaximum seconds to wait for navigation and selector readiness per URL.
maxPageHeightintegeroptionalClip full-page images at this CSS height. 0 means unlimited. PDFs keep their full document height and ignore this limit. Truncation is reported in the record.
proxyConfigurationobjectoptionalOptional proxy override. The actor starts direct and uses an Apify AUTO datacenter proxy only after a real block when this is empty. Residential is never selected automatically.

3. Start an Actor run

Set APIFY_TOKEN in your environment. Python 3.10 or newer is sufficient; this recipe uses no third-party packages.

Execution may incur charges. Review current pricing on Apify. The request asks for a 120-second timeout and a charge limit; these settings are subject to Apify’s pricing and do not guarantee an all-inclusive spending cap.

import json
import os
import urllib.request

# Save the schema-derived example as input.json; review and edit it first.
with open("input.json", encoding="utf-8") as stream:
    actor_input = json.load(stream)

token = os.environ["APIFY_TOKEN"]
request = urllib.request.Request(
    "https://api.apify.com/v2/acts/oG0Mque4wwAd1e4EK/runs?timeout=120&maxTotalChargeUsd=0.50",
    data=json.dumps(actor_input).encode("utf-8"),
    headers={"Authorization": "Bearer " + token, "Content-Type": "application/json"},
    method="POST",
)
# This starts a potentially billable run. Do not automatically retry this POST.
with urllib.request.urlopen(request, timeout=40) as response:
    run = json.load(response)["data"]
print("Run ID:", run["id"])
print("Status:", run["status"])
# Inspect and download results in Apify Console once the run succeeds.

4. Inspect the actual results

Open the run in Apify Console and wait for a successful completion. Use the published output schema to locate results and the dataset schema to understand declared views. Missing or optional record fields must not be treated as guaranteed values.

One record per captured URL, with the file link, page metadata, block/error classification and capture evidence.

Questions before you run

Which inputs are required?

The published required fields are urls

What does this guide verify?

The fields, prefills, and schema links are rendered from the published build. This is a usage recipe, not a paid live extraction test. Source availability and collection results can vary.

What if the run request times out?

Check Apify Console before retrying. The first request may already have created a run. Do not automatically repeat a run-creation POST.

Generated from source build ugu5kWKeaoli71PqF and its README and schemas. Source changes regenerate this guide; no third-party editorial claims are inferred.