Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Use Puppeteer’s page.locator(selector).fill(value) to find and fill login fields. A CSS selector can identify an input by a stable attribute such as name; you usually do not need a long positional DOM path. Locators wait for the element and relevant action conditions, which makes them the practical default for login forms.
Use a stable selector, not a brittle DOM path
A DOM path describes where an element sits in the document, for example through a chain of nested elements. That can identify an input, but a path based on position—such as “the second input inside the third div”—can break when the page’s markup changes.
Prefer a selector tied to the field’s meaning or a stable attribute, such as input[name="username"] or input[type="password"]. If the page provides an accessible label, Puppeteer also supports selectors based on accessible name and role. Puppeteer accepts CSS directly and offers extended selector syntax for text, XPath, accessibility, and supported Shadow DOM traversal. See the Puppeteer page interactions guide and selector guide.
Choose selectors based on the page you are automating: inspect its rendered form, then use the shortest selector that uniquely identifies the intended control. A selector is only as robust as the attribute or label it relies on; even semantic selectors need updating if the site changes its form.
#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.
Fill login fields with Puppeteer Locator
The following example uses ES modules and the Locator API. Replace the URL and selectors with values verified for your login page, and supply username and password from your application’s configured secret mechanism.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.test/login');
// Replace these selectors with ones verified for the page.
await page.locator('input[name="username"]').fill(username);
await page.locator('input[name="password"]').fill(password);
// Keep this pattern when submitting is expected to navigate.
const [response] = await Promise.all([
page.waitForNavigation(),
page.locator('button[type="submit"]').click(),
]);
} finally {
await browser.close();
}
This illustrates the documented interaction pattern; the example URL, selectors, and credential variables are not universal or tested against a particular site. The navigation wait belongs alongside the submit click when the click is expected to navigate. Waiting for navigation only after clicking can miss the start of navigation; Puppeteer documents registering both waits together with Promise.all (Puppeteer waitForNavigation() API).
What fill() can fill
Puppeteer’s Locator fill(value) supports input controls, textareas, selects, and contenteditable elements. For checkboxes, radio buttons, and switches, pass a boolean rather than text. The implementation chooses a filling method based on the element’s runtime type; check the Locator fill() API for the current supported behavior.
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.
Why Locator is the default
Locator actions wait for the element and relevant readiness conditions, and retry when an action fails because the element is not ready. For a click, documented checks include viewport presence, visibility, enabled state, and stable geometry. That behavior helps with fields that render after page navigation or application startup without requiring a separate wait for each ordinary action. The details can change between Puppeteer releases.
Find the right login field
Use the live page’s markup and accessible interface to establish selectors before automating. An input’s name, type, label, or other stable attribute is generally more useful than its position among siblings.
- Named username field:
input[name="username"]is concise when the page actually uses that name. - Password field:
input[type="password"]can work if there is one password field on the page; if there are multiple, narrow it with a stable surrounding form or other attribute. - Accessible name: use an accessibility selector when the field exposes a meaningful label. Puppeteer’s getting-started guide demonstrates filling an input by accessible name (Puppeteer getting started).
- Deep or positional path: reserve this for pages where no stable semantic selector is available, and expect to revisit it if the document structure changes.
Do not assume that a selector from one website, language, or login state applies to another. Login pages may change fields after a locale choice, a security prompt, or a prior interaction; use selectors and success conditions specific to the page being automated.
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.
Locator versus an explicit selector wait
A Locator combines selection and action and is the recommended high-level interaction pattern. An explicit waitForSelector() can still be useful when you need a lower-level wait or are maintaining existing code, but the wait and later action remain separate operations.
| Approach | Useful when | Readiness behavior | Main trade-off |
|---|---|---|---|
page.locator(selector).fill(value) |
You want to select and fill a supported control in one interaction. | The Locator waits for the element and action readiness, retrying when the action cannot yet proceed. | Selector quality still matters; Locator does not make a positional path stable. |
page.waitForSelector(selector, { visible: true }) |
You need an explicit lower-level wait or have existing code organized around a selector wait. | Waits for a matching visible element, but does not itself retry a subsequent fill or other action. | You must handle the next action separately and consider what happens if the element changes or disappears. |
The documented default timeout for waitForSelector() is 30,000 milliseconds. You can set a different timeout or disable it; consult the API reference for the current option names and behavior. For a normal login field that Locator can fill, prefer Locator rather than splitting the wait and action without a reason.
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 minutePC 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 & 11Explicit wait example
await page.waitForSelector('input[name="username"]', { visible: true });
await page.locator('input[name="username"]').fill(username);
This demonstrates the separation: the explicit wait establishes that a visible match exists, while the following action is its own operation. If the desired action is supported by a Locator, using just the Locator action is usually simpler.
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
Wait for the right result after submitting
Not every login submission causes a full navigation. If the app uses a single-page flow, waiting for navigation may never resolve as expected. Instead, wait for a success indicator or state change that is specific to that application—for example, a known account-page element or a page-specific confirmation. There is no universal success selector; determine it from the site you control or are authorized to automate.
If submitting does navigate, use the concurrent navigation-and-click pattern in the example. If it does not, replace the navigation wait with the application-specific result condition rather than stacking unrelated waits.
Troubleshoot common failures
Locator times out or cannot find the input
- Cause: The selector does not match the rendered page, the field has not appeared, or the form is in a different state.
- Fix: Inspect the current page and verify the selector against its actual attributes and accessible name. Check whether a prior choice or interaction is required before the field renders.
The script fills the wrong field
- Cause: The selector is broad or matches multiple inputs, such as a generic
inputselector. - Fix: Narrow the selector using a stable name, type, label, or form context. Avoid choosing by index unless the page offers no better identifier and you accept the maintenance risk.
The value is not accepted
- Cause: The matched control may not be a text input, or it may be a select, contenteditable region, checkbox, radio button, or switch with different value semantics.
- Fix: Confirm the control type and pass a value supported for it; boolean controls take a boolean. See the current fill API details.
Submission wait hangs or fails
- Cause: The form submission may update the page without navigation, or the click may not submit the form.
- Fix: Determine whether the page navigates. If it does, register
waitForNavigation()and click together. If it does not, wait for an application-specific success condition instead.
An explicit selector wait succeeds but the next action fails
- Cause: A successful selector wait is not a guarantee that the element remains ready for a later action.
- Fix: Prefer a Locator action that combines waiting and interaction when it supports the task. If using lower-level APIs, handle the wait and action as distinct steps.
Version and compatibility notes
The official Puppeteer interaction documentation and API search results displayed version 25.12.0 for the current guide at the time this material was checked, while some API pages displayed 25.9.0. These are version-specific references, not a guarantee that every installed Puppeteer release behaves identically. If your installed version differs, verify Locator methods, selector syntax, and wait defaults against the documentation for that version before relying on a particular detail.
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.
Or skip the browser setup
If you only need an image or PDF of a login page or other URL—not an automated authenticated login flow—you can request a capture from ScreenshotNeo, a website screenshot API and MCP server for developers. It does not replace Puppeteer’s form interaction: a screenshot request captures a page, while the code above fills fields and can submit a form.
One GET request returns an image or PDF. For example, save a WebP screenshot with cURL (see the ScreenshotNeo documentation):
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie/consent banners, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and whether the request was billed. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools 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 free for 1,000 screenshots a month with no card.
Free tools Windows power users keep installed
One-click scans. No signup required.
Frequently Asked Questions
Can I use XPath instead of CSS to find a login field?
Yes. Puppeteer’s extended selector syntax supports XPath as well as CSS, text, accessibility selectors, and supported Shadow DOM traversal. Choose the selector form that fits the page and remains understandable.
Does Puppeteer’s fill action click the login button?
No. Fill the relevant controls, then explicitly click the page’s submit control or use the form’s intended submission mechanism.
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.

