Skip to main content
Module

x/puppeteer/mod.ts>Frame#type

A port of puppeteer running on Deno
Latest
method Frame.prototype.type
Re-export
import { Frame } from "https://deno.land/x/puppeteer@16.2.0/mod.ts";

Sends a keydown, keypress/input, and keyup event for each character in the text.

Examples

Example 1

await frame.type('#mytextarea', 'Hello'); // Types instantly
await frame.type('#mytextarea', 'World', {delay: 100}); // Types slower, like a user

Parameters

selector: string
  • the selector for the element to type into. If there are multiple the first will be used.
text: string
  • text to type into the element
optional
options: { delay: number; }
  • takes one option, delay, which sets the time to wait between key presses in milliseconds. Defaults to 0.

Returns

Promise<void>