How to Save HTML as a JPG Using Power Automate
Use Power Automate for desktop to render an HTML page, capture the full page or an element, and save it as a JPG file.
Use Power Automate for desktop’s browser automation. Open or attach to a supported browser, navigate to the HTML page, wait for its content to render, then add Take screenshot of web page. Set Capture to Entire web page or Specific element, set Save mode to File, choose a destination path, and select JPG as the file format.
Microsoft describes this action as taking a screenshot of the web page or an element currently displayed in the browser and saving the image to a file or the clipboard. See the Browser automation actions reference for the current action names and options.
What you need
- Power Automate for desktop installed on a Windows machine.
- A supported browser such as Microsoft Edge, Google Chrome, Mozilla Firefox, or Internet Explorer. Browser behavior and labels can vary by version.
- A URL, or an HTML file that the browser can render. For local files, use a
file:///URL or serve the file through a local web server. - Write permission for the folder where the JPG will be saved.
Step-by-step: save a web page as JPG
- Open Power Automate for desktop and create a new flow.
- Add Launch new browser, or use Attach to running browser if the page is already open.
- Enter the page URL. For a local file, provide its complete path or a
file:///address. - Add the browser navigation action needed to open the target page.
- Add a wait condition. Prefer waiting for a distinctive element that proves the page is ready. A fixed delay can be used when no reliable selector exists.
- If the page loads images or other content lazily, scroll through the page before capturing it so those resources are requested.
- Add the Take screenshot of web page action.
- Set Capture to Entire web page for a full-page JPG, or Specific element to capture one DOM element.
- Set Save mode to File.
- Enter an absolute path in Image file, such as
C:\\Exports\\page.jpg. - Set File format to JPG.
- Run the flow and verify that the file exists before uploading or moving it.
Example flow layout
Launch new Microsoft Edge
URL: https://example.com/report
Wait for web page content
Condition: selector for the report heading exists
Take screenshot of web page
Capture: Entire web page
Save mode: File
Image file: C:\\Exports\\report.jpg
File format: JPG
If file exists: C:\\Exports\\report.jpg
Upload or move the file
Else
Handle the failure
Entire page versus a specific element
| Capture choice | Use it when | Typical issue |
|---|---|---|
| Entire web page | You need a document-like image of the complete rendered page. | Very tall pages can create large files or expose content below the fold that was not intended for the output. |
| Specific element | You need a chart, invoice, card, table, or other component. | The selector must match an element that exists after rendering. |
Use a specific element when the page contains navigation, advertisements, or unrelated content. Use the full-page option when the screenshot is an archival copy or a complete report.
Preparing HTML before capture
Wait for asynchronous content
HTML can be present before its JavaScript has finished loading data. Wait for a heading, table row, chart container, or other element that appears only after the required work completes. If the page has no dependable selector, add a delay and make the flow verify the output file afterward.
Load lazy images
Images that load only when scrolled into view may be missing from an immediate screenshot. Scroll through the page, wait briefly, and then capture. For a specific element, bring that element into view first.
Control the page state
Close dialogs, dismiss consent notices, sign in when required, and set the desired filters before the screenshot action. A browser dialog such as Save as, Open, or Upload is outside normal web automation; use desktop recorder or UI automation for those dialogs.
Local HTML files
A local file must be renderable by the selected browser. Relative CSS, JavaScript, fonts, and images must resolve from the file’s location. If browser security rules prevent local assets from loading, serve the directory locally and navigate to its HTTP address instead.
Saving, naming, and downstream actions
Use an absolute path and make the filename unique when a flow runs repeatedly. A timestamp or record identifier prevents one run from overwriting another.
C:\\Exports\\reports\\report_2026-10-01_1530.jpg
After the screenshot action, add file handling to upload the JPG to SharePoint, OneDrive, or another destination. Keep the upload after a file-exists check so a failed capture does not create a misleading downstream success.
Common errors and fixes
| Error or symptom | Cause | Fix |
|---|---|---|
| Element selector was not found | The selector changed, the page is not ready, or the element is inside a frame. | Re-record or update the selector, wait for the element, and confirm the correct frame and browser tab. |
| Screenshot could not be taken | The browser is detached, minimized in an unsupported state, still navigating, or the page did not render. | Attach to the browser again, keep the target tab active, wait for navigation and required content, then retry. |
| File could not be saved | The directory does not exist, the path is invalid, or the account lacks write permission. | Create the directory, use a full path, avoid invalid filename characters, and test permissions. |
| JPG is blank or incomplete | Capture happened before JavaScript, fonts, images, or API data finished loading. | Wait for a meaningful selector, scroll for lazy content, and capture only after the final state is visible. |
| Consent banner covers the page | The site requires an interaction before showing its content. | Add a click action for the accept or close control before the screenshot step. |
| Unexpected login page | The flow has no authenticated browser session. | Sign in during the flow or attach to a browser profile that already has the required session, subject to your organization’s policies. |
Reliability checklist
- Attach to the intended browser instance and tab.
- Wait for a content-specific selector instead of relying only on a short delay.
- Scroll when the page uses lazy loading.
- Use stable selectors based on IDs or distinctive attributes.
- Write to a directory that exists and is writable by the flow account.
- Check that the JPG exists and has a nonzero size before downstream processing.
- Record the source URL, capture time, and output path for troubleshooting.
Performance and operating considerations
Capture time is dominated by browser startup, navigation, JavaScript execution, network requests, and image loading. Reusing an attached browser can avoid startup overhead, while waiting on a precise ready condition avoids unnecessary fixed delays. Full-page captures generally require more rendering work than a single element.
Power Automate for desktop runs on the machine executing the flow, so screen state, browser updates, network access, and sleep or lock policies can affect unattended runs. Test the exact browser version and desktop-flow configuration used in production.
When to use a service instead
A desktop flow is useful when the page requires an interactive session, local files, or other machine-side actions. A rendering API is often simpler for scheduled, server-side, or high-volume captures because it avoids browser installation and desktop session management.
Or skip the browser setup
ScreenshotNeo provides a single GET request that returns a PNG, JPEG, WebP, or PDF. Its capture options include full-page screenshots with lazy images loaded, CSS-selector element capture, custom CSS and JavaScript, waits, device presets, cookies and headers, dark mode, blocking rules, caching, signed links, asynchronous jobs, and bulk capture. Documentation: ScreenshotNeo API docs.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
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)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
Cookie banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers identify the page verdict and billing result. An MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf. The Free plan includes 1,000 screenshots each month with no card; paid plans start at $5 for 3,000 shots.
Create a free ScreenshotNeo account to get started.
FAQ
Can a cloud flow alone take this screenshot?
The documented native screenshot action is in Power Automate for desktop browser automation. A cloud flow can trigger or receive the result from a desktop flow, but the browser capture itself runs in the desktop environment.
Can I save to the clipboard instead of a file?
Yes. The screenshot action supports clipboard output as an alternative to file output. Use file output when another action needs a persistent JPG path.
Can I capture only a chart or table?
Yes. Choose Specific element and provide a selector for the chart, table, or other element after it has rendered.
Why does my output look different from the browser?
Responsive breakpoints, browser zoom, fonts, authentication state, animations, and unfinished network requests can change the rendered result. Set the desired viewport and state, disable or wait for animations where possible, and capture after the page is ready.


