0

Is it possible to get objectId from ElementHandlelike in Playwright like in Puppeteer element.remoteObject().objectId? Thanks!

In puppeteer:

let elementHandle = await page.evaluateHandle(() => document.querySelector('a'));  
let objectId = elementHandle.remoteObject().objectId;

Playwright??

Alex
  • 388
  • 3
  • 4
  • 1
    What are you trying to achieve with this , may be somebody can suggest you better alternate way to achieve the same goal. – Vishal Aggarwal Apr 12 '23 at 13:35
  • I find the element I need through the Chrome DevTools Protocol. I use the DOM.getNodeForLocation call. I need to select it in Playwright. I can find the xpath to the element in the dev protocol, and then xpath in Playwright. This is a slow solution. – Alex Apr 13 '23 at 15:57

1 Answers1

0

As of the time of writing, I do not see the same remoteObject method in Playwright’s docs for its comparable handles. May be something to submit an issue in their GitHub for if you have a need for it?

David R
  • 493
  • 2
  • 8
  • this is more suited as comment than as an answer. – Vishal Aggarwal Apr 12 '23 at 13:33
  • 1
    I felt like in this case the answer to the question posed was “no”. That being said, I was torn about where to put it, and like your comment asking for clarification about his goal in case there’s another approach entirely to suggest. – David R Apr 12 '23 at 17:39