How to Type a Text in Input Box In Webpage Using Selector in Puppeteer

You are currently viewing How to Type a Text in Input Box In Webpage Using Selector in Puppeteer

How to Type a Text in Input Box in Webpage Using Selector in Puppeteer Full Tutorial For Beginners

await page.type('input[name=pickupAgingComment]', 'test comment', {delay: 20})

const frame = page.frames().find(frame => frame.url() === "https://accounts.spreadshirt.de/login?context=partner&lang=de");
let input = await frame.waitForSelector('input[type="email"]');
await input.type("email@email.com");

const browser = await puppeteer.launch({
    headless: false,
    slowMo: 100, // slow down by 250ms
});
const page = await browser.newPage();
await page.goto('https://cb01.tattoo/');
await page.waitForSelector('.form-control.mb-2.mr-sm-2.mb-sm-0');
console.log('passed');
 
await page.$eval('.mobileShow', el => el.style.display = 'block'); // Unhide parent.
 
await page.type('.form-control.mb-2.mr-sm-2.mb-sm-0', 'hello');
console.log('end');

Ranjith

Hi, I'm Manoj a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply