-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] ElementHandle.getTagName() #4845
Comments
our const tagName = await $parent.evaluate(e => e.tagName);
// or
const tagName = await $parent.getProperty('tagName'); |
@JoelEinbinder thanks. I tried Thanks |
All of these run in the main context. You expect the page to fight you on Considering we have |
Do the calls like I'm trying to trust the pages I'm running on as little as possible. The particular thing I'm working on right now is trying to build up some bread crumbs from a target element up to the root, so that we can attempt to find it again later. For this I want to keep going up the tree and recording what the tag types are (along with other info like |
It looks like async _evaluateInUtility<R, Arg>(pageFunction: js.Func1<[js.JSHandle<InjectedScript>, ElementHandle<T>, Arg], R>, arg: Arg): Promise<R> {
const utility = await this._context.frame._utilityContext();
return utility.evaluateInternal(pageFunction, [await utility.injectedScript(), this, arg]);
} Is this an isolated context? I could probably submit a PR to add |
@tjenkinson: I'd stick with |
Folding into #4377 |
I'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
The text was updated successfully, but these errors were encountered: