PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, 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 minuteUse a scheduled Playwright job: put the HTTP Basic Authentication username and password in a browser context, open the protected page, wait for the content you need, and save a screenshot. The scheduler runs that script on a recurring basis; it is separate from the browser’s authentication and capture steps. This guide covers HTTP Basic Authentication, not a site’s ordinary HTML login form.
Confirm which kind of authentication the page uses
HTTP Basic Authentication is the browser/server challenge that asks for credentials before serving a page. In Playwright, configure those credentials on the browser context, rather than trying to pass them as a screenshot option. You can restrict credentials to an origin so they are not sent to unrelated sites. See Playwright’s browser context documentation.
A site that displays its own username-and-password form uses an application login flow instead. For that case, automate the form and consider saving and reusing authenticated browser state as described in Playwright’s authentication guidance. Do not treat a login form as an HTTP Basic challenge.
Create a Playwright screenshot script
Below is a Node.js example for HTTP Basic Authentication. It reads credentials from environment variables, opens a fresh browser context, waits for a page-specific readiness selector, then saves a full-page PNG. Install Playwright and its browser first using the steps in the Playwright CI guide; the runner must also have the required browser dependencies.
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
import { chromium } from 'playwright';
const username = process.env.BASIC_AUTH_USERNAME;
const password = process.env.BASIC_AUTH_PASSWORD;
const targetUrl = process.env.TARGET_URL;
const readySelector = process.env.READY_SELECTOR;
if (!username || !password || !targetUrl || !readySelector) {
throw new Error('Set BASIC_AUTH_USERNAME, BASIC_AUTH_PASSWORD, TARGET_URL, and READY_SELECTOR');
}
const browser = await chromium.launch({ headless: true });
try {
const context = await browser.newContext({
httpCredentials: {
username,
password,
origin: new URL(targetUrl).origin,
},
});
try {
const page = await context.newPage();
const response = await page.goto(targetUrl, { waitUntil: 'domcontentloaded' });
if (!response || !response.ok()) {
throw new Error(`Navigation failed: ${response?.status() ?? 'no response'}`);
}
await page.locator(readySelector).waitFor({ state: 'visible', timeout: 30000 });
await page.screenshot({ path: 'screenshot.png', fullPage: true });
} finally {
await context.close();
}
} finally {
await browser.close();
}
Set READY_SELECTOR to an element that indicates the content you intend to inspect is ready—for example, a report heading or a dashboard container. No single readiness condition works for every site. If a fixed visible area is what matters, change fullPage: true to fullPage: false to capture the viewport. Playwright’s screenshot API documents file output and full-page capture at Screenshots.
Schedule the script to run
The scheduler should invoke the script in an environment that can reach the protected page and install or provide the required browser. You can use an existing CI workflow or a system scheduler on a maintained host. Choose based on where the page is reachable, how secrets are stored, who handles failed runs, and where output images are retained.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
For CI, configure the provider’s scheduling trigger to run the same workflow that installs dependencies and executes the script. Playwright’s CI documentation covers running browser automation in CI, but the schedule syntax and availability depend on your provider; consult its current documentation. On a system you manage, configure its scheduler to run the script on your desired cadence, with the environment variables supplied securely to that process.
- Put the script and dependency setup in the repository or deployment environment used by the runner.
- Add
BASIC_AUTH_USERNAME,BASIC_AUTH_PASSWORD,TARGET_URL, andREADY_SELECTORthrough the runner’s secret and configuration settings. - Set the schedule in the CI provider or system scheduler, and configure the output destination and failure notifications.
- Run once manually before enabling the recurring schedule. Confirm the image is complete and that failed runs are visible to someone responsible for the job.
Protect credentials and captured images
- Do not commit passwords or authenticated state files. Playwright warns that state files can contain cookies and headers capable of impersonating an account and says, “We strongly discourage checking them into private or public repositories.” Its authentication guidance also recommends adding the authentication-state directory to
.gitignore. - Use the runner’s secret mechanism, grant access only to the people and jobs that need it, and avoid printing secrets in logs.
- Restrict access to the screenshots and their storage location: authenticated pages may contain sensitive information.
- If the site is available only on a private network, ensure the scheduled runner has authorized network access rather than exposing the page publicly for convenience.
Keep recurring captures comparable
For visual comparisons over time, keep the browser version, operating system, viewport, browser settings, and headless mode consistent where possible. Playwright notes that rendering can vary with operating system, browser version, settings, hardware, power source, and headless mode. Even with a stable environment, dynamic page content can change between runs, so wait for a meaningful site-specific condition rather than relying only on a fixed delay.
Recommended Free Tools
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Troubleshoot common failures
- The page keeps prompting for credentials or returns an authorization error: Check that the username and password are current, the page really uses HTTP Basic Authentication, and the context’s
originmatches the protected page’s origin. If credentials are wrong or the site uses a form login, the Basic Authentication configuration will not complete sign-in. - The job works locally but fails on the schedule: Check that the scheduled environment has the browser and its dependencies installed, can reach the target network location, and receives the required environment variables. Review the runner’s logs without exposing secret values.
- The screenshot is blank or misses content: Wait for an element that represents the rendered content, verify that the selector is correct, and capture after it becomes visible. A navigation event alone may occur before asynchronous page content is ready.
- The image is too short or captures the wrong area: Use full-page capture for the scrollable document or viewport capture for the visible browser area. Confirm the page’s layout and viewport are what you expect.
- Images differ across runs despite no intended change: Standardize browser and runner settings and investigate changing page content. Rendering differences can arise from the execution environment as well as the site.
- Images are missing or exposed after a successful run: Check the runner’s artifact retention and access controls. Treat screenshots of protected pages as sensitive outputs, not as harmless logs.
Or skip the browser setup
ScreenshotNeo offers a screenshot API and MCP server for developers. A single GET request can return a PNG, JPEG, WebP, or PDF; for a protected page, pass the required authorization details using the API’s supported options. Consult the ScreenshotNeo API documentation for authentication and request parameters.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Its capture flow removes known cookie/consent banners, newsletter popups, and chat widgets before the shot; bot checks, blank pages, and failed loads are not billed. AI agents can take screenshots through its MCP server. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.
Learn about ScreenshotNeo or sign up free for 1,000 screenshots a month, with no card required.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Frequently Asked Questions
Can I schedule screenshots of a password-protected page automatically?
Yes. For HTTP Basic Authentication, provide credentials to the Playwright browser context and have a scheduler run the script. A page with its own login form needs a different authentication flow.
Should I capture the viewport or the full page?
Use viewport capture for the visible browser area and full-page capture when you need the document’s full scrollable length.
Quick Recap
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
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.

