puppeteer - access cdp from client - Stack Overflow

Without having read too much about cdp (only the main cdp page and the getting started guide) - is it p

Without having read too much about cdp (only the main cdp page and the getting started guide) - is it possible at all to get a nodeId on the client?

My use case would be roughly this

const handle = elementHandleFromNodeId(await page.evaluate(() => {
  return getNodeIdOfElementSomehow(document.getElementById("test-id"));
});

And yes, I am fully aware of the fact that I can just do page.$("#test-id") but that's not what I want to do. The full use case is a bit too large for a SO question.

My current workaround involves setting a unique data* attribute and querying that on the backend but if possible at all I'd like to avoid that.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745203588a4616473.html

相关推荐

  • puppeteer - access cdp from client - Stack Overflow

    Without having read too much about cdp (only the main cdp page and the getting started guide) - is it p

    11小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信