简体   繁体   中英

Need of xpath:position & xpath:attribute

I am working on a record tool (in JavaScript) similar to Selenium. For Playback I need the XPath position and its attributes (see below screenshot from Selenium).

How can I find the position and attributes in JavaScript?

硒工具片段供参考

You can use css selector:

document.querySelector("li:nth-of-type(4) input[name='leg0']");

or

document.querySelectorAll("li:nth-of-type(4) input[name='leg0']");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM