Not able to select by attribute/class
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version:1.19.0
- Platform / OS version:MacOS
- Node.js version:v10.4.1
Trying to select this
<a class="KxR2cf-za" title="Click Here">Click Here</a>
and using this code
const elementHandle = await page.$('a[class="KxR2cf-za"]');
console.log(elementHandle);
however console is printing null even though chromium shows the node in UI. What am i doing wrong ?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Not able to select by attribute/class · Issue #4909 - GitHub
Platform / OS version:MacOS; Node.js version:v10.4.1. Trying to select this. <a class="KxR2cf-za" title="Click ...
Read more >CSS attribute selectors not selecting - Stack Overflow
Possible solutions would be to re-order the class attribute values to ensure that *-window appears at the end. Alternatively, you could use the...
Read more >Attribute selectors - CSS: Cascading Style Sheets | MDN
The CSS attribute selector matches elements based on the presence or value of a given attribute.
Read more >How To Select HTML Elements Using ID, Class, and Attribute ...
To begin, open your styles. css file in the text editor. In the HTML there is a link that goes to the website...
Read more >Select by Attributes misses records? - Esri Community
I'm running Select By Attributes on a feature class to select shape area less than 300, but only a fraction of the records...
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
@vsemozhetbyt … that was it !! I was looking for element in main frame, but element was in an iframe. after fetching right iframe, it worked perfectly. Thank you !
@qwertangel Can it be that the element is inside an
iframe
?