Puppeteer Wyczyść wejście
// You can use page.evaluate to manipulate DOM as you see fit:
await page.evaluate( () => document.getElementById("inputID").value = "");
// Here we press Backspace as many times as there are characters in that field:
const inputValue = await page.$eval('#inputID', el => el.value);
for (let i = 0; i < inputValue.length; i++) {
await page.keyboard.press('Backspace');
}
/*
Another interesting solution is to click the target field 3 times.
so that the browser would select all the text in it and then you could just type what you want:
*/
const input = await page.$('#inputID');
await input.click({ clickCount: 3 });
await input.type("Blah");
2589