Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteUse PhantomJS’s webpage module to open a URL, then call page.render('screenshot.png') from the page-open callback. Save the script as capture.js and run phantomjs capture.js. PhantomJS is discontinued: its homepage says development is suspended, and its GitHub repository has been archived as read-only. Treat this as legacy-maintenance guidance, not a recommended foundation for a new system.
Capture a page and save it as PNG
Create a file named capture.js containing this version, which checks whether the page loaded before writing an image:
| # | Preview | Product | Price | |
|---|---|---|---|---|
| 1 |
|
Responsive Web Design Toolkit | $51.16 | Buy on Amazon |
As an Amazon Associate I earn from qualifying purchases.
var page = require('webpage').create();
page.open('https://example.com/', function (status) {
if (status !== 'success') {
console.error('Unable to load the page.');
phantom.exit(1);
return;
}
page.render('screenshot.png');
phantom.exit();
});
Replace https://example.com/ with the page you want to capture. Run the script through the PhantomJS executable:
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallphantomjs capture.js
The string passed to page.render() is the image destination; using the .png extension requests PNG output. The official tutorial’s basic example likewise opens a page, renders a PNG, and exits. See the official screen-capture tutorial and command-line reference.
#1 Best Overall
Set the viewport and capture rectangle
Set page.viewportSize to choose the browser viewport and page.clipRect to select the rectangle rendered into the image. Add these settings before page.open():
var page = require('webpage').create();
page.viewportSize = { width: 1024, height: 768 };
page.clipRect = { top: 0, left: 0, width: 1024, height: 768 };
page.open('https://example.com/', function (status) {
if (status !== 'success') {
console.error('Unable to load the page.');
phantom.exit(1);
return;
}
page.render('screenshot.png');
phantom.exit();
});
These settings describe the rendered frame; a viewport-sized capture should not be assumed to include an entire long page. The official tutorial documents PNG, JPEG, GIF, and PDF render formats. For this task, use a PNG filename such as screenshot.png. Details are in the capture documentation.
What to know before maintaining a PhantomJS script
The PhantomJS project homepage states, “Important: PhantomJS development is suspended until further notice.” Its GitHub repository was archived on May 30, 2023 and is read-only. That status matters if you are choosing a tool for new infrastructure: weigh compatibility and security implications rather than assuming current development or binaries for every operating system. The sources cited here do not establish binary availability across current operating systems. Read the project status and archived repository.
Troubleshoot failed or unexpected captures
The script reports that PhantomJS is missing or the wrong version
Check which executable is being used with phantomjs --version. The official troubleshooting page notes that multiple installed versions can cause conflicts. The documented CLI form is phantomjs [options] somescript.js [arg1 ...]; the reference is for PhantomJS 2.1.1. See official troubleshooting guidance and the CLI reference.
page.open() returns fail
The callback status is either success or fail. Do not treat an output from a failed load as a valid screenshot; keep the status check and investigate the URL or loading failure. The page.open() API documents the callback status.
The page has a certificate error
The CLI reference lists SSL-related controls, including --ignore-ssl-errors, which changes certificate-error handling. Do not use it as a routine fix: disabling validation can hide a genuine certificate problem. Check the site’s certificate and your runtime configuration first. See the command-line options.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. Its API can return a PNG, JPEG, WebP, or PDF from one GET request. For example, save this as a PNG with cURL:
Free tools Windows power users keep installed
One-click scans. No signup required.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.png
See the ScreenshotNeo documentation for API details. ScreenshotNeo accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be switched off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.
Frequently Asked Questions
Can PhantomJS save a screenshot in formats other than PNG?
Yes. Its screen-capture tutorial lists JPEG, GIF, and PDF as other render formats.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




