Page.click() does not work with an input selector #3347
Closed
Description
Steps to reproduce
Tell us about your environment:
- Puppeteer version: 1.8.0
- Platform / OS version: Windows 10
- URLs (if applicable):
- Node.js version: 8.11.4
What steps will reproduce the problem?
I am trying to use page.click() to go to the username filed in Instagram. If I use the selector input[name='username'] in developer console it works. However, puppeteer keeps throwing an error that no node was found
Please include code that reproduces the issue.
const puppeteer = require('puppeteer');
(async () => {
try {
const Browser = await puppeteer.launch({headless:false,
defaultViewport:{width:600,height:800},
waitUntil: ['load','domcontentloaded','networkidle0','networkidle2'],
timeout :0
});
const page=await Browser.newPage();
await page.goto('https://www.instagram.com/accounts/login/?source=auth_switcher');
await page.click('input[name="username"]');
await page.keyboard.type('NewUser');
await Browser.close();
console.log("Iam done!");
} catch(e) {console.log('main program error:' + e);
}
})();
What is the expected result?
I should be able to type my username
What happens instead?
Puppeteer can't find the user name field