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

Use page.keyboard.type(text) to enter text in the currently focused element, page.keyboard.press(key) to tap a key, and down() followed by up() to hold a key while another action runs. If you need a particular field to receive input, focus it deliberately with a locator or selector first.

Choose the right keyboard method

Task Method What it does
Enter text page.keyboard.type(text) Sends a keydown, keypress/input, and keyup sequence for each character.
Tap a key page.keyboard.press(key) Performs a key down and up; suitable for keys such as Enter and ArrowDown.
Keep a key held down(key), action, then up(key) Keeps the key active across subsequent keyboard actions, as with Shift plus an arrow key.
Send character input events only page.keyboard.sendCharacter(char) Emits keypress and input events without keydown or keyup.

Puppeteer describes Keyboard as “an api for managing a virtual keyboard.” The browser page exposes it as page.keyboard; it sends browser keyboard and input events rather than requiring a physical keyboard.

Type text into the focused element

First make sure the intended control is focused. Then call type() with the text:

await page.keyboard.type('Hello');

By default, the optional delay between key events is 0 milliseconds. Add a delay when your test or page behavior needs slower event timing:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
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.
await page.keyboard.type('Hello', { delay: 100 });

The delay controls timing; it does not establish that the input is indistinguishable from a person typing. Also, type() takes the supplied text as-is: a held modifier does not transform it. For example, holding Shift and calling type('hello') does not make the text uppercase.

Target a field with a selector or locator

Keyboard actions go to the focused element, so do not assume a text field receives input just because it is visible. Focus a known target first. For a selector-based helper, Puppeteer also documents page.type(selector, text, options):

Rank #2
Sale
Logitech MK270 Full Size Wireless Keyboard and Mouse Combo - Black
  • 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
await page.type('#email', 'reader@example.com');

The selector helper supports CSS and Puppeteer selector syntax. If you already have an element handle, ElementHandle.type() is another documented option. For new code, a locator can express the target explicitly; the getting-started example combines a keyboard shortcut with a locator to fill the Search field.

Press a key once

Use press() for a discrete key action. Puppeteer documents it as a shortcut for down() followed by up().

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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*
await page.keyboard.press('Enter');
await page.keyboard.press('ArrowDown');

Key names are defined by Puppeteer’s KeyInput type; examples include Enter, Backspace, and ArrowDown. Use the documented key name rather than guessing a label from a keyboard layout.

Hold and release a key

Use down() and up() when a key must remain held while another key action occurs. This is useful for selecting text with Shift:

Rank #4
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
await page.keyboard.down('Shift');
await page.keyboard.press('ArrowLeft');
await page.keyboard.up('Shift');

While Shift is held, subsequent key presses carry the modifier. Release it when the modified actions are finished; a down() call alone is not a complete tap. Repeated down() calls on a key set repeat after its initial press.

For a longer selection example, the API reference types “Hello World!”, presses ArrowLeft, holds Shift while moving left across “ World”, releases Shift, then presses Backspace, leaving “Hello!”.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Logitech K270 Full Size Wireless Keyboard for Windows - Black
  • 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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Send character events without keydown or keyup

sendCharacter(char) emits keypress and input events only. It is a specialized choice for cases where that narrower event sequence is specifically wanted; it is not a substitute for the ordinary key sequence produced by type().

Use keyboard shortcuts with deliberate targeting

A keyboard shortcut and a field-targeting operation solve different problems: the shortcut triggers page behavior, while a locator or selector ensures text goes into the intended field. Puppeteer’s getting-started example opens the search menu on developer.chrome.com with page.keyboard.press('/'), fills the accessible Search field using a locator, then clicks a result.

Limitations and common problems

  • Text goes to the wrong place: the page keyboard acts on the focused element. Focus the intended control with a locator or selector before typing.
  • Shift did not capitalize text passed to type(): type() sends the text you gave it; modifiers do not alter that text. Supply the desired characters, or use modifier-aware key presses when that event behavior is needed.
  • A key appears stuck or changes later actions: pair each intentional down() with up() when finished, especially for modifiers.
  • A macOS Select All shortcut does not work: Puppeteer’s API reference specifically warns that macOS shortcuts such as ⌘ A for Select All do not work. Do not assume a workaround based on the keyboard API documentation.
  • You need selector-directed typing: use page.type(selector, text, options) or an element handle’s type(), rather than relying on whichever element happens to have focus.

Or skip the browser setup

If your goal is a clean page capture rather than keyboard-driven browser automation, ScreenshotNeo provides a one-request screenshot API. It is a separate capture tool, not a Puppeteer keyboard method. One GET request returns an image or PDF; see the ScreenshotNeo API documentation.

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, newsletter popups, and chat widgets are removed before the shot; each cleanup step can be turned off.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers report the page verdict and billing status.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents.
  • The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.

Sign up free for 1,000 screenshots a month, with no card required.

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

Quick Recap

Bestseller No. 1
SaleBestseller No. 3
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Plastic parts in K120 include 51% certified post-consumer recycled plastic*; Product carbon footprint: 4.02 kg CO2e
$12.34
SaleBestseller No. 5
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Plastic parts in K270 include 38% certified post-consumer recycled plastic; Eight hot keys: For instant access to the Internet, e-mail, music volume and more
$21.48

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.