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 :(得分:0)
打开浏览器控制台并输入:
document.addEventListener('click', function(event){console.log(event.target)});
现在点击任何元素并检查控制台 - 您的元素将被打印。所以肯定可以做到)
您还可以查看这些文章: