New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 841683 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Last visit 28 days ago
Closed: Dec 8
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Feature



Sign in to add a comment

Get XPATH of a specified node in JavaScript

Reported by suguru.i...@gmail.com, May 10 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36

Steps to reproduce the problem:
In DevTool, I can get an XPATH of a node only in DevTools GUI.

What is the expected behavior?

What went wrong?
I want to get it in JavaScript (with Puppeteer) in order to serialize specified node's location as a string. 

Is there an API for that?

Did this work before? N/A 

Chrome version: 66.0.3359.139  Channel: stable
OS Version: OS X 10.12.6
Flash Version:
 

Comment 1 by woxxom@gmail.com, May 10 2018

This is apparently a feature request for devtools protocol, component: Platform>DevTools>Platform  

Comment 2 by alph@chromium.org, May 10 2018

Components: -Platform>DevTools Platform>DevTools>Authoring
Labels: -Type-Bug OS-Linux OS-Windows Type-Feature
Owner: lushnikov@chromium.org
Status: Assigned (was: Unconfirmed)
Status: WontFix (was: Assigned)
You can generate node selector similarly to how we do it in devtools front-end. In general, having a "node" in hands, you can generate its selector from-inside the page using `Runtime.evaluate`. (or page.evaluate, from pptr standpoint)

Feel free to jump to pptr bugtracker with this question if there's some confusion left.

Sign in to add a comment