国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Unable to get input element from website
P粉574695215
P粉574695215 2024-04-06 18:59:57
0
1
1016

So I'm trying to get an input element from Twitter but when I run it it keeps giving me an error like this in node terminal and as a result the browser window created by this code will close itself as it finds Not having the correct input selector. How do I get the correct type of input?

Error: Element of selector not found: input[name="text"]

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    headless: false,
  })
  const page = await browser.newPage();
  page.setViewport({
    width: 1280,
    height: 800,
    isMobile: false
  })
  await page.goto("https://twitter.com/i/flow/login");
  await page.type('input[name="text"]', 'username', {delay: 25})
})();

I tried different selectors, including the class attribute, but I still get the error

P粉574695215
P粉574695215

reply all(1)
P粉704196697

You need to waitForSelector appear on the page before entering. That's why you get the error, it can't find the element.

  await page.waitForSelector('input[name="text"]');
  await page.type('input[name="text"]', 'username', {delay: 25})
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template