VBA从WebPage获取所有ObjectsName和Xpath

时间:2017-10-20 14:36:31

标签: xml vba xpath

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.

1 个答案:

答案 0 :(得分: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)