Hi all,
I know that Selenium has FindByXpath, but due to policy security reasons in the office, I cannot install or use exe files.
My issue is that I want to get elements from a website using XPath expressions. I've found this nice function getXPathElement() that works with full xpath expressions, but I need to find elements by Xpath that contains some text.
For example, if I want to get the element that contains the text HTML Editors from the url https://www.w3schools.com/html/, the full Xpath is
and one option of Xpath based on a text could be
With first Xpath, the function getXPathElement it works, but it fails with the second XPath. Is there a way to modify the function to accept not only full Xpaths? or is there another way to get elements by Xpath from web page without installing Selenium?
This is my current code:
I've also tried the SelectNodes function but I get run-time error 13 in last command "Set elem = doc.SelectNodes(...)"
Thanks for any help.
Bookmarks