2017-10-20 38 views
0
 
I am trying to create a tool that will get All objects from a webpage including its valid xpaths. 

For example: 

In a Login Page where the following objects are usually seen: 

username textbox 
password textbox 
login button 
cancel button 

It will return all these objects together with their respective XPATHs. 

OR at least if you click the Object then the tool will get the Object and its corresponding XPATH, 


Is this even possible? Appreciate your feedback, Thank you. 

回答

0

打开浏览器控制台,输入:

document.addEventListener('click', function(event){console.log(event.target)}); 

现在点击任何元素,并检查控制台 - 你的元素将被打印。因此,确保它可以做)

您还可以查看这些文章:

I'm storing click coordinates in my db and then reloading them later and showing them on the site where the click happened, how do I make sure it loads in the same place?

Get unique selector of element in Jquery

Get element's CSS selector (when it doesn't have an id)

+0

谢谢您的答复。这是在VBA还是Java中完成的? – Toshi

+0

它可以用JavaScript等来完成,或者像浏览器插件一样)我认为把它作为一个独立的应用程序或以任何其他方式做它是一个非常糟糕的主意),但我希望有人会提出更好的建议)这个信息只是供参考,而不是期待是正确的答案 –