i use page.type(selector, text[, options]) i want to input one element ,but actual input other element
See original GitHub issuecode:
const puppeteer = require('puppeteer');
puppeteer.launch().then(async function(browser) {
const page = await browser.newPage();
await page.goto("https://github.com/", { waitUntil : ['load', 'domcontentloaded']});
await page.type(".js-chromeless-input-container .js-site-search-focus", "841185308");
await page.screenshot({path: '2.png', fullPage: true});
})
What is the expected result?
What happens instead?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
<input>: The Input (Form Input) element - HTML
The <input> HTML element is used to create interactive controls for web-based forms in order to accept data from the user; a wide...
Read more >page.type() doesn't work but element.setAttribute() does?
Apparently an element has to be visible before page.type() will work, whereas setting the element's value via attribute doesn't care as long ...
Read more >5 Selectors
The :focus pseudo-class applies while an element has the focus (accepts keyboard events or other forms of text input). An element may match...
Read more >Element selectors | Playwright
Selectors are strings that point to the elements in the page. They are used to perform actions on those elements by means of...
Read more >Scraping & asserting on page elements
How to scrape web page elements like texts, buttons and forms with Google ... We use $page.eval() and pass it two arguments: 1)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The following works just fine for me:
@yanguoyu try setting a larger viewport, it worked for me when I did
await page.setViewport({width: 1200, height: 1500});