Learn how to get Free YouTube subscribers, views and likes
Get Free YouTube Subscribers, Views and Likes

Web Scraping in Power Automate for Desktop (Full Tutorial)

Follow
Anders Jensen

This full tutorial shows how to do web scraping in Microsoft Power Automate for Desktop. Learn how to extract data from any web page and save it to Excel.

You're guided through the basic scraping features, and you learn the excellent advanced features, such as Regex, manipulating the scraping data, and dynamic naming.

Course materials: https://andersjensen.org/microsoftpo...

VIDEOS FOR YOU:
Full Power Automate for Desktop Course:    • Power Automate Desktop for Beginners  
My RPA Developer Salary:    • My RPA Developer Salary & Pay (with R...  

‍‍‍ Discord:   / discord  
Join my network with 4000+ RPA Developers, where we solve RPA problems, network, and help each other upgrade our careers. It's free!

FOLLOW ME:
LinkedIn:   / andersjensenorg  
Instagram:   / andersjensenorg  
Facebook:   / andersjensenorg  
Twitter:   / andersjensenorg  
Email Newsletter: https://andersjensen.org/emailnewsle...

MY MONITOR (Amazon affiliate):
Samsung 49inch CRG9 Curved Monitor = https://geni.us/MDpejc
If you are buying this, I can recommend the Mi Monitor Light Bar = https://geni.us/3Wwad

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 handson 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 dropdown 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.

#microsoft #powerautomate #office365

posted by Puketae3