VOOZH about

URL: https://apify.com/rmed19/html-to-png-actor

⇱ Html To Png Actor Β· Apify


Pricing

$25.00 / 1,000 results

Go to Apify Store

Captures PNG screenshots of webpages and converts HTML to PNG

Pricing

$25.00 / 1,000 results

Rating

0.0

(0)

Developer

πŸ‘ Mohammed Rhamnia

Mohammed Rhamnia

Maintained by Community

Actor stats

1

Bookmarked

17

Total users

0

Monthly active users

4 months ago

Last modified

Share

Automated HTML to PNG Screenshot Generator

Overview

This Apify Actor captures PNG screenshots of webpages and converts HTML to PNG with configurable options, including custom window size settings.

Features

  • Supports capturing a single URL.
  • Configurable browser window size.
  • Stores screenshots in Apify Key-Value Store.
  • Automatically deletes old screenshots after 7 days.

Input Configuration

The Actor accepts the following input parameters:

{
"url":"https://apify.com",
"width":1280,
"height":720
}

Parameters

  • url (string) - The URL of the webpage to capture.
  • width (integer, optional) - Defines the browser viewport width size. Default: 1280 pixels.
  • height (integer, optional) - Defines the browser viewport height size. Default: 720 pixels.

Usage Example

Using the Apify Python Client to run the Actor and retrieve screenshots:

from apify_client import ApifyClient
# Initialize the ApifyClient with your API token
client = ApifyClient("your_apify_api_token")
# Prepare the Actor input
run_input ={
"url":"https://example.com",
"width":1024,
"height":768,
}
# Run the Actor and wait for it to finish
run = client.actor("your_actor_id").call(run_input=run_input)
store_client = client.key_value_store(run['defaultKeyValueStoreId'])
# Retrieve and save screenshot
screenshot_key =f"screenshot-{int(time.time())}-{run_input['url'].replace('https://','').replace('http://','').replace('/','_')}.png"
record = store_client.get_record_as_bytes(screenshot_key)
if record isnotNoneand'value'in record:
withopen(screenshot_key,"wb")as f:
f.write(record['value'])
print(f"Saved {screenshot_key}")
else:
print(f"No record found for key: {screenshot_key}")

Output

The Actor generates a PNG screenshot and stores it in the Key-Value Store.

License

This project is protected under a closed-source license. Unauthorized use, distribution, modification, or replication is strictly prohibited without prior written permission from the creator. Contact the project owner for licensing inquiries.

You might also like

Screenshots from HTML

vojtam/screenshots-from-html

Actor creates screenshots from a saved HTML structure.

πŸ‘ User avatar

VojtΔ›ch MaΕ‘lÑň

75

Universal Web Printer

autofacts/universal-web-printer

A powerful web rendering Actor that converts URLs and HTML to PDF, PNG, JPEG, or WebP. Features smart scroll-stitch for full-page captures, element-level extraction, reading mode, watermark and PDF merging.

31

Website Screenshot

i-scraper/website-screenshot

⚑️ Website screenshot: easy-peasy screenshots, PNG & JPG formats

Website Screenshot & PDF API β€” Fast Captures

george.the.developer/screenshot-pdf-api

Capture pixel-perfect screenshots and PDFs from any URL in under 3 seconds. PNG/JPEG/WebP formats, custom viewports, full-page capture, batch up to 20 URLs.

18