
Html To Png Actor
Pricing
$25.00 / 1,000 results

Html To Png Actor
Captures PNG screenshots of webpages and converts HTML to PNG
0.0 (0)
Pricing
$25.00 / 1,000 results
1
Total users
5
Monthly users
1
Runs succeeded
>99%
Last modified
3 months ago
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 tokenclient = ApifyClient("your_apify_api_token")# Prepare the Actor inputrun_input = {"url": "https://example.com","width": 1024,"height": 768,}# Run the Actor and wait for it to finishrun = client.actor("your_actor_id").call(run_input=run_input)store_client = client.key_value_store(run['defaultKeyValueStoreId'])# Retrieve and save screenshotscreenshot_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 is not None and 'value' in record:with open(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.