[Feature] ElementHandle.getTagName()
See original GitHub issueI’d like to retrieve the name of the tag from a playwright.ElementHandle
, and it seems like this is not possible at the moment.
Something like
const $parent = await $el.$('xpath=..');
const tagName = await $parent.getTagName(); // <--
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
puppeteer howto get element tagName - Stack Overflow
It appears your elements is an array of ElementHandle s. ... jsonValue() ... const tagName = await page.evaluate( element => element.
Read more >Element.tagName - Web APIs | MDN
The tagName read-only property of the Element interface returns the tag name of the element on which it's called.
Read more >ElementHandle | Flood Element
Fetches the remote elements physical dimensions as width and height . Parameters. returns: Promise<Size>. tagName() #. Fetches the remote elements tagName ...
Read more >Puppeteer - Getting Element Attribute - Tutorialspoint
We can get attribute values of an element using Puppeteer. The attributes are added within the HTML tag. They are used to describe...
Read more >ElementHandle class - Puppeteer
If the given function returns a promise, then this method will wait till the promise resolves. $x(expression) · asElement() · boundingBox(), This method...
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
our
ElementHandle
extendJSHandle
, so you can doYep that was me (https://github.com/microsoft/playwright/issues/4377)
I will need the the call to be isolated. Happy to try and open a PR for #4377 if someone could point me in the right direction, otherwise I’ll probably end up adding this in a fork because it looks simpler and using that for now.