How to Screenshot a Web Page with PowerShell on Windows
Capture a web page from Windows with Edge, PowerShell browser automation, or Power Automate Desktop. Learn the limits, setup choices, and common fixes.
Short answer: PowerShell can coordinate a browser that renders a page and saves a screenshot, but the Microsoft sources covered here do not document a built-in PowerShell cmdlet for capturing arbitrary web pages. For a one-off capture, use Microsoft Edge Screenshot. For a repeatable workflow, use a browser automation stack such as Selenium through a PowerShell module, or use Power Automate Desktop for a desktop flow.
Choose the route based on whether you need a manual image, an automated capture, or a selected element. Before relying on any route for a long page, check whether it captures the full document or only the visible browser area.
1. Choose a capture method
| Need | Method | What to check |
|---|---|---|
| One quick screenshot | Edge Screenshot | Whether your Edge policy allows the feature. |
| Repeatable PowerShell workflow | Selenium WebDriver through a PowerShell module | Module commands, browser and driver compatibility, capture scope, and cleanup. |
| Desktop automation or a selected UI element | Power Automate Desktop | Browser instance, UI element selection, output destination, and image format. |
| Automated browser capture using Microsoft’s documented sample | Playwright with Node.js | This is a JavaScript route invoked separately from PowerShell, not a native PowerShell API. |
Microsoft documents Playwright automation for Edge with a Node.js installation and JavaScript screenshot example. Playwright launches headless by default, and can also launch Edge in headed mode. Microsoft’s Playwright guide describes the supported setup.
2. Take a one-off screenshot in Edge
- Open the target page in Microsoft Edge and wait for the content you need to appear.
- Press Ctrl+Shift+S, or choose Screenshot from the Edge menu.
- Select the capture area or page content using Edge’s screenshot controls, then save or copy the result.
- Open the saved image to confirm that it includes the content and dimensions you expected.
Microsoft documents the Screenshot feature for web pages and PDF content, and lists Windows support from Edge version 87. On managed devices, an administrator can restrict screenshot-related functionality; availability may depend on policy and capture path. See the WebCaptureEnabled policy documentation.
3. Automate capture from PowerShell with Selenium
PowerShell Selenium modules provide a bridge to Selenium WebDriver. The exact install and command syntax depends on the module and version you choose. The PowerShell Gallery includes Selenium-related packages, including one whose listed commands include Get-ScreenShot and Save-ScreenShot; inspect the package’s current instructions before using them. The older Selenium 3.0.0 module source is version-specific, so do not treat it as a universal current setup recipe.
Selenium’s screenshot documentation describes capturing the current browsing context. A basic browser screenshot may cover only the current viewport; confirm full-page behavior with the chosen browser, driver, and module before depending on it for long documents. Selenium’s window and tab documentation provides context on WebDriver browsing contexts.
Set up your Windows environment
- Choose a maintained PowerShell module and review its installation instructions and supported browser versions.
- Install the required browser and driver components using that module’s documented method. Browser and driver compatibility can change; do not assume a driver from a different release will work.
- Run PowerShell in the environment where the browser and driver are available. For unattended jobs, account for the Windows user profile and permissions that the browser needs.
- Use the module’s documented commands to start a browser, navigate to the URL, wait for the page, capture the screenshot, and close the session in a cleanup path.
Because the available package sources do not provide a current, universal end-to-end PowerShell recipe across modules and browser versions, there is no safe single set of install and screenshot commands to give here as if it applied to every setup. Use the selected module’s own examples verbatim, then verify the resulting image. This avoids presenting JavaScript or C# syntax as PowerShell.
Make the capture reliable
- Wait for content: navigation completion does not necessarily mean client-rendered text, lazy images, or fonts are ready. Use the module’s documented wait-for-element or wait strategy when available.
- Control the viewport: set a consistent browser window size if your module supports it; responsive layouts can change substantially with width.
- Check capture scope: test a long page and confirm whether the image contains the full document or just what was visible.
- Clean up: close the browser and WebDriver even when navigation or capture fails, to avoid leaving browser processes behind.
- Validate output: check that the file exists, has nonzero length, and opens as an image.
4. Use Power Automate Desktop for a desktop flow
Power Automate Desktop documents a Take screenshot of web page browser action. It can capture the entire currently displayed page or a specific UI element, and send the image to a file or clipboard. Documented output formats include BMP, EMF, EXIF, GIF, JPG, PNG, TIFF, and WMF.
- Create or open a desktop flow and establish a browser instance using the browser automation actions.
- Add the web page screenshot action and choose the entire displayed page or a selected UI element.
- Choose a file or clipboard destination and the required format.
- Run the flow and inspect the output, especially for pages with dynamic content or elements that load below the fold.
The action requires a browser instance; element capture also requires a selected UI element. Microsoft lists possible failures involving finding an element, writing to a file or clipboard, and taking the screenshot. Consult the browser automation actions reference for its current action details.
5. Use Playwright with Node.js when that fits your automation
If you want Microsoft’s documented Playwright path, run it as a Node.js script and invoke that script from PowerShell as a separate process. This example follows the documented Playwright API shape; install Playwright and its browser dependencies according to the Microsoft Edge Playwright guide.
// save as capture.mjs
import { chromium } from 'playwright';
const url = process.argv[2];
if (!url) throw new Error('Usage: node capture.mjs https://example.com');
const browser = await chromium.launch({ channel: 'msedge', headless: true });
try {
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
await page.goto(url, { waitUntil: 'networkidle', timeout: 60000 });
await page.screenshot({ path: 'page.png', fullPage: true });
} finally {
await browser.close();
}
Run it from PowerShell with:
node .\capture.mjs https://example.com
The example explicitly asks Playwright for a full-page screenshot. Sites with persistent network activity may never reach networkidle; if that happens, wait for a meaningful selector or use a deliberate delay instead. The code uses a fixed viewport for repeatable responsive layout. Confirm that the installed Playwright package and Edge browser are available in your environment.
6. What “full page” means
Browser capture methods differ in whether they save the visible viewport, a selected element, or a full document. The reviewed Selenium sources establish capture of the current browsing context, while Power Automate Desktop describes the entire currently displayed page or a selected UI element. Those descriptions do not establish identical full-document behavior across every module and setup.
For long pages, validate the image rather than inferring its scope from an action name. Check for the final section, sticky headers repeated during scrolling, lazy-loaded images, and content that appears only after interaction. If exact full-page output matters, use a method whose documentation explicitly supports it and test the target page.
7. Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| PowerShell says a screenshot command is unknown | The selected module does not export that command, or a different module/version is loaded. | Check the installed module name and version and use its own command reference. Do not assume commands from another Selenium module apply. |
| Browser fails to start | Browser or driver is missing, incompatible, inaccessible, or not configured as the module expects. | Follow the module’s current browser-driver setup instructions and verify the executable paths and versions. |
| Screenshot is blank or missing page content | The page has not rendered the needed content, navigation failed, or content requires a later event. | Wait for a page-specific element or other documented readiness condition; check the URL and browser errors. |
| Only the visible portion appears | The capture API or module captures the current viewport rather than the full document. | Check that method’s documented scope. Use an explicitly supported full-page option or capture and validate using another route. |
| Power Automate Desktop cannot find an element | The selected UI element is stale, hidden, or not present when the action runs. | Re-capture the element and add a wait or flow condition before the screenshot action. |
| Screenshot cannot be saved | The output path is invalid, the directory is unavailable, or the destination is not writable. | Use an existing writable directory, confirm the format and path, and check that the flow or PowerShell process has access. |
| Edge Screenshot is unavailable | Edge is outdated or an administrator policy restricts the feature. | Check the Edge version and managed-browser policy; use an allowed automation route if policy permits. |
| Playwright waits indefinitely for network idle | The site maintains long-lived requests or continual background traffic. | Wait for a selector that marks the content you need, or use a bounded delay. Keep a timeout so the script can fail clearly. |
8. Performance, reliability, and cost
Local browser automation performs rendering on the Windows machine that runs the browser. Capture time depends on the page, browser startup, network, and chosen waits; the research sources provide no benchmark that applies across sites or machines. Reuse a browser session when the workflow allows it, avoid waiting for conditions unrelated to the screenshot, and always set bounded timeouts.
For reliability, pin and document the module and browser setup used by your workflow, check the screenshot artifact, and close browser sessions in cleanup code. A network failure, bot check, or site-specific rendering issue can produce an unusable image even if the capture call itself completes.
Local browser routes require you to manage their browser and automation dependencies. For a hosted API alternative, ScreenshotNeo offers a free plan and paid plans; see its current website and API documentation for product details and usage.
Or skip the browser setup
ScreenshotNeo takes a screenshot through one GET request. It accepts cookie and consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. ScreenshotNeo also has an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents.
Here is a PowerShell call that saves the returned image:
$query = [System.Web.HttpUtility]::ParseQueryString([string]::Empty)
$query['access_key'] = 'YOUR_API_KEY'
$query['url'] = 'https://stripe.com'
$uri = 'https://api.screenshotneo.com/v1/shot?' + $query.ToString()
Invoke-WebRequest -Uri $uri -OutFile 'shot.webp' -TimeoutSec 90
For other clients, these equivalent examples use the same API endpoint. See the ScreenshotNeo API docs for options.
cURL
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo includes full-page capture with lazy images loaded, CSS-selector element capture, 12 device presets plus custom viewports, retina scale, dark mode, and PNG, JPEG, WebP, or PDF output. Other options include custom CSS and JavaScript, clicking or hiding elements, waits, request blocking, custom headers and cookies, user agent, timezone and geolocation, transparent backgrounds, resizing, configurable cache TTL, signed links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, a usage API, and an OpenAPI spec. Parameter names used by other screenshot APIs also work. Every feature is on every plan.
Plans are Free for 1,000 screenshots per month with no card, Starter at $5 for 3,000, Growth at $15 for 15,000, Pro at $39 for 60,000, Scale at $99 for 250,000, and Business at $249 for 1,000,000; yearly billing gives two months free. Paid plans start at $5 for 3,000.
Try ScreenshotNeo free: sign up for 1,000 screenshots a month with no card.
FAQ
Can PowerShell take a web page screenshot by itself?
The reviewed Microsoft sources do not document a native PowerShell cmdlet that renders an arbitrary web page. Use PowerShell with browser automation, a desktop flow, or Edge’s built-in capture for manual work.
Can I use Playwright directly from PowerShell?
The Microsoft example uses Playwright’s JavaScript API and Node.js. You can invoke a Node.js script from PowerShell, but that does not make the Playwright API a native PowerShell interface.
Can I capture just one element?
Power Automate Desktop documents capture of a selected UI element. Selenium module capabilities depend on the module and its current commands. ScreenshotNeo also supports capturing an element by CSS selector.
Does Edge Screenshot work on PDFs?
Microsoft documents Edge Screenshot for web and PDF content. A managed-device policy may affect feature availability.


