UiPathTeam.XPathWebScrape.Activities


#1

This Custom Activity is a wrapper on top of HTML Agility Pack ( http://html-agility-pack.net/ ) to allow using XPath queries ( https://www.w3schools.com/xml/xpath_intro.asp ) against HTML pages (obtained with HTTP request).

NOTE: It does not work with dynamic (Java Script) components/controls, just static HTML content (so no Angular, React, Ajax based sites).

You can get ready-made XPath selectors by using Google Chrome to open the page of interest, right clicking an element, Inspect, right click HTML definition, choose Copy and then “Copy XPath” - then you can adjust that selector, make it more generic, etc).

Output is a List of strings.

Test Case 1:
Attribute: “INNERHTML”
URL: “https://www.w3schools.com/xml/xpath_intro.asp
XPath Selector: “//*[@id=”“main”"]/h2"

Test Case 2:
Attribute: “href”
URL: “https://www.w3schools.com/xml/xpath_intro.asp
XPath Selector: “//*[@id=”“main”"]/div[4]/a[1]"

Package: UiPathTeam.XPathWebScrape.Activities
Author: @cornel