Power Automate Desktop for Beginners 

Web Scraping in Power Automate for Desktop (Full Tutorial)

CLICK 2 INTRO

0:00 Intro

It's straightforward to scrape web data in Power Automate for Desktop. Use a Launch new browser instance and then an Extract data from web page action to save the data from the web site into either a variable or an Excel sheet. In the hands-on use case, we read an Excel sheet, do online searches, scrape the result and then write it back into Excel sheets.


7:16 Initialization

Create an Excel instance for the scraped results with a Launch Excel action. Then create another Excel instance for our input data. The input data defines what data we want to scrape. Here it's Amazon search terms. We read the search terms into a DataTable to make it easy to work with. Use a Set active Excel worksheet to strengthen the robustness of the robot.


18:45 Web Scraping

To scrape the correct data, we create a robust flow that takes us to the right page. Use a Launch Chrome action and fill in the URL. Use a For each action to iterate through the DataTable. Use a Set drop-down list value on web page to pick Books in the drop down. The Populate text field on the web page lets you search for something. The click link on the webpage enables you to click elements on a webpage. A best practice is to navigate to the start page before each scraping. This ensures that the actions are performed the same in all scrapings. The add new worksheet adds a new Excel worksheet for each scraping. Now we're ready to do the web scraping in Power Automate for Desktop. Use an Extract data from web page action and open the website to the scraping wizard. Mark your structured data with the Live web helper. The Write to Excel worksheet action writes the results back to Excel. In the end, we'll have a Close Excel action to close Excel and save the scraped results.


32:58 Add Excel Headers

You can add the headers to the scraped results in the Live web helper, but with a Set variable and a Write to Excel worksheet it's fully customizable.


37:34 Scrape Multiple Pages

Create a UI element for the Next button. After each data scraping, we click the Next button with Power Automate and then do another scraping. The Loop is the action you want to use.


41:53 Dynamic File Naming

We don't want our results to get overwritten each time the robot runs. The trick is to get the current date and time, convert it to a text and use it in the file naming.


45:40 Regex

You can use RegEx directly in the live scraping helper to manipulate your data. RegEx is a series of characters that defines a search pattern. We use the search pattern to define what data we want out of the extracted data. 

.....     .....     .....

.....     .....     .....