October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Send a Character or Type Text with Puppeteer

Use Puppeteer's keyboard and selector APIs to type text, send a single character, press named keys, and handle modifier and focus pitfalls.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To type ordinary text into a focused field with Puppeteer, use await page.keyboard.type('Hello'). To enter text into a specific selector, use page.type(selector, text). For a named key such as Enter, use page.keyboard.press('Enter'); use sendCharacter() only when you specifically need its smaller set of input events.

Choose the Puppeteer API for the input you need

Task API Behavior
Type text into the currently focused element page.keyboard.type(text, options?) Sends keydown, keypress/input, and keyup events for each character.
Type text into an element selected by CSS selector page.type(selector, text, options?) Targets the matching element and supports an optional per-character delay.
Send only a character’s keypress and input events page.keyboard.sendCharacter(char) Does not send keydown or keyup.
Press a named key page.keyboard.press(key) Performs keyboard down-and-up behavior for a key such as Enter or ArrowDown.
Set a field’s value through a locator page.locator(selector).fill(value) Fills the field value; use keyboard typing instead when per-character keyboard events matter.

These distinctions are documented in Puppeteer’s Keyboard.type(), Keyboard API, Page.type(), and getting started guide.

As an Amazon Associate I earn from qualifying purchases.

Type into the focused field

First focus the intended input or textarea, then call page.keyboard.type(). For example:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.keyboard.type('Hello');
await page.keyboard.type('World', {delay: 100});
await page.keyboard.press('Enter');

The optional delay is measured in milliseconds between characters and defaults to 0. The first two calls type text; the last sends a separate named-key press.

#1 Best Overall
Sale
Amazon Basics Wired QWERTY Keyboard, Works with Windows, Plug and Play, Easy to Use with Media Control, Full-Sized, Black
  • KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
  • EASY SETUP: Experience simple installation with the USB wired connection
  • VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
  • SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
  • FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.

Type into a selector or locator

Selector-based typing

Use page.type() when you want to identify the field by selector rather than arrange focus separately:

await page.type('#mytextarea', 'Hello');
await page.type('#mytextarea', 'World', {delay: 100});

The selector-targeted method supports the same optional delay, which defaults to zero. For special keys, use page.keyboard.press().

Rank #2
Sale
Logitech MK270 Full Size Wireless Keyboard and Mouse Combo - Black | Full size keyboard with spill-resistant design, compact ambidextrous mouse, connect via single included USB-A Nano Receiver
  • Reliable Plug and Play: The USB receiver provides a reliable wireless connection up to 33 ft (1), so you can forget about drop-outs and delays and you can take it wherever you use your computer
  • Type in Comfort: The design of this keyboard creates a comfortable typing experience thanks to the low-profile, quiet keys and standard layout with full-size F-keys, number pad, and arrow keys
  • Durable and Resilient: This full-size wireless keyboard features a spill-resistant design (2), durable keys and sturdy tilt legs with adjustable height
  • Long Battery Life: MK270 combo features a 36-month keyboard and 12-month mouse battery life (3), along with on/off switches allowing you to go months without the hassle of changing batteries
  • Easy to Use: This wireless keyboard and mouse combo features 8 multimedia hotkeys for instant access to the Internet, email, play/pause, and volume so you can easily check out your favorite sites

Locator-based filling

Puppeteer’s current getting-started guide demonstrates opening a search field with a keyboard action and then using a locator’s fill() method to set its value. Choose fill() when setting the field value is the goal; choose keyboard typing when the page needs the per-character keyboard event sequence.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Send one character or a named key

sendCharacter() is not a full key press

page.keyboard.sendCharacter(char) dispatches keypress and input events, but not keydown or keyup. Use it only when that event behavior is what the page requires; it is not equivalent to typing a character through the full keyboard sequence.

Rank #3
Sale
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
  • All-day Comfort: The design of this standard keyboard creates a comfortable typing experience thanks to the deep-profile keys and full-size standard layout with F-keys and number pad
  • Easy to Set-up and Use: Set-up couldn't be easier, you simply plug in this corded keyboard via USB on your desktop or laptop and start using right away without any software installation
  • Compatibility: This full-size keyboard is compatible with Windows 7, 8, 10 or later, plus it's a reliable and durable partner for your desk at home, or at work
  • Spill-proof: This durable keyboard features a spill-resistant design (1), anti-fade keys and sturdy tilt legs with adjustable height, meaning this keyboard is built to last
  • Plastic parts in K120 include 51% certified post-consumer recycled plastic*

Use press() for keys such as Enter

Call page.keyboard.press('Enter') for Enter, or pass another supported key name such as ArrowLeft. Puppeteer’s KeyInput reference lists supported key names.

Use down and up for modifier-sensitive sequences

For actions that depend on a modifier key, use the keyboard API’s down() and up() around the relevant key press. Modifier keys affect down() and press(); they do not transform the text passed to keyboard.type(). Holding Shift and then calling keyboard.type('hello') will not turn the supplied string into uppercase.

Rank #4
Sale
Redragon K521 Upgrade Rainbow LED Gaming Keyboard, 104 Keys Wired Mechanical Feeling Keyboard with Multimedia Keys, One-Touch Backlit, Anti-Ghosting, Compatible with PC, Mac, PS4/5, Xbox
  • 【Dreamy Rainbow Gaming Keyboard】K521 Gaming Keyboard Adopts a Different LED Backlight Design, Upgraded on the Traditional LED Backlight Effect, Making the Light More Penetrating, Giving You a More Dazzling Visual Effect, Making Your Gaming Process More Enjoyable
  • 【One Touch Opens & Visual Feast】The K521 Red Dragon Keyboard has a One-Touch on/off Lighting Button for Added Convenience. It also has a Three-Position Adjustable Breathing Mode and a Four-Position Adjustable Brightness Lighting Mode
  • 【Mechanical Feeling & Fast Tapping】The PC Keyboard Keys are Designed for Mechanical Feeling, Giving You a Better Feel During Use and the Ability to Trigger Keys Quickly, Allowing You to Win All Your Games
  • 【19 Keys Anti-Ghosting Keyboard】Anti-Ghosting Ensures Every Button Can Be Triggered. This Allows You to Trigger Key Combinations In The Game Accurately, And Each Skill Can Be Accurately Released to Increase Your Winning Rate. Redragon K521 Will Be Your Perfect Partner
  • 【12 Multimedia Combination Keys】The K521 Wired Gaming Keyboard is Equipped with 12 Multimedia Keys That Can Greatly Enhance Your Gaming/Office Efficiency and Make It More Convenient to Use

Troubleshoot text that does not appear as expected

  • Nothing is entered: keyboard.type() sends text to the focused element. Focus the intended field first, or use page.type(selector, text).
  • A special key is treated like text: use page.keyboard.press('Enter') or the relevant named key instead of type().
  • Shift does not capitalize typed text: pass the desired capitalization in the string itself; held modifiers do not affect keyboard.type().
  • The page responds differently than expected to sendCharacter(): it omits keydown and keyup. Use keyboard.type() if the full per-character sequence is required.
  • Typing is too fast for the interaction: set the optional per-character delay in milliseconds, for example {delay: 100}.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is to capture a page rather than automate text input, ScreenshotNeo can return a screenshot with one GET request. Its API accepts a URL, and the code and request options are documented at ScreenshotNeo docs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
  • Cookie banners are accepted and removed before capture; known consent platforms, newsletter popups, and chat widgets can also be removed, with each step configurable.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing; response headers identify the page verdict and whether the request was billed.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.
  • The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo and get 1,000 free screenshots a month, with no card.

Best Value
Sale
Logitech K270 Full Size Wireless Keyboard for Windows - Black | Full-size keyboard with number pad, 8 multimedia keys, includes USB-A receiver, 2-year battery, compatible with PC, laptop
  • All-day Comfort: This USB keyboard creates a comfortable and familiar typing experience thanks to the deep-profile keys and standard full-size layout with all F-keys, number pad and arrow keys
  • Built to Last: The spill-proof (2) design and durable print characters keep you on track for years to come despite any on-the-job mishaps; it’s a reliable partner for your desk at home, or at work
  • Long-lasting Battery Life: A 24-month battery life (4) means you can go for 2 years without the hassle of changing batteries of your wireless full-size keyboard
  • Simply plug the USB receiver into a USB port on your desktop, laptop or netbook computer and start using the keyboard right away without any software installation
  • Simply Wireless: Forget about drop-outs and delays thanks to a strong, reliable wireless connection with up to 33 ft range (5); K270 is compatible with Windows 7, 8, 10 or later

Frequently Asked Questions

Does Puppeteer type into the currently focused element?

Yes. page.keyboard.type(text) sends text to the focused element.

How do I press Enter after typing?

Call await page.keyboard.press('Enter') separately.

Does Puppeteer’s typing delay use seconds?

No. The optional delay is in milliseconds per character and defaults to zero.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.