If you’re a technophobe, you probably want to avoid coding at all costs.
Thankfully, Microsoft Power Automate empowers you to create powerful workflows without a jot of code. No-code (and low-code) solutions are all the rage in 2022, so it’s time to jump on the bandwagon!
I must confess: I’m new to Power Automate, and you probably are too. This guide will only give a glimpse of the magical things you can do with this tool, and it’ll focus on web scraping.
The reasons for web scraping are varied. Examples include:
- market research
- price comparison
- competition monitoring
- lead generation
- sports betting odds analysis
Power Automate fills the void Excel has as a web scraper. If you’ve ever used the From Web option in the Data tab, you’ll know how restrictive it is. Unless your chosen website displays tabular data in HTML tables, you’re stuck. VBA can circumvent these limitations, but it’s fiddly and bothersome.
What are we going to scrape?
We’re going to scrape the basic profile information for every single Microsoft MVP. There are 3,121!
The website uses pagination as well, which makes it a good introductory example.
A Microsoft Most Valuable Professional (MVP) is an award for individuals who’ve exhibited outstanding technical expertise and a passion for sharing knowledge in their technical community.
Power Automate for desktop comes preinstalled on Windows 11, so just search for it. For prior versions, download it from the Microsoft Store.
Given the nature of what we’re doing, you’ll also require the web browser add-on/extension:
This guide assumes you’re using Microsoft Edge, so adapt any instructions for Google Chrome, if necessary.
More information about the installation process is found on Microsoft’s website.
Let’s scrape the data
Open Power Automate and select New flow.
Enter ‘Microsoft MVP Data’ as the Flow name, and then select Create.
In the Browser automation dropdown, drag Launch new Microsoft Edge into the main pane for a pop-up window to appear.
Paste https://mvp.microsoft.com/en-us/MvpSearch into the Initial URL field.
Keep the default options for Launch mode and Window state, as we want a fresh regular-sized browser window to open.
Select Run to open the website.
Select Recorder to open the Recorder window.
Select Record to start scraping.
Right-click on the first profile image and select Extract element value > Src.
Details of your latest action appends to the previous one in Recorded actions.
There are also several options available:
- Temporarily halt any actions from registering.
- Remove all actions from the list.
- Remove the unwanted action from the list.
Extract the name, Award Category, and Country or region using the same process as the previous step, except choosing the Text option instead.
Right-click the second profile image and select Extract element value > Src.
Boom! The elements of the other profiles all get selected. Power Automate knows what you’re trying to do, eh?
Right-click the Next page symbol and select Set this element as pager to ensure each page is cycled through.
At this point, the Recorded actions has updated to reflect your intentions. The four values of each profile are stored in the variable
Select Done to confirm the actions.
Power Automate added an unnecessary Launch Microsoft Edge action when the recorder started. To remove this, right-click on it and choose Delete.
Double-click on Extract data from web page to launch a new window.
In the Store data mode dropdown, choose Excel spreadsheet to update the variable to
ExcelInstance, and then select Save.
In the Excel dropdown, drag Save Excel into the main pane.
In the Save mode dropdown, choose Save document as, select a file destination and name for the Document path. Then select Save.
In the Excel dropdown, drag Close Excel into the main pane.
In the Before closing Excel dropdown, choose Save document and then select Save.
Save your flow and then select Run to execute it.
Sit back and enjoy!
Microsoft Edge opens the website and the MVP profile data is extracted from all 174 pages. The process takes about 13 minutes.
Once finished, you’ll see a glimpse of the data as Excel briefly opens and closes.
Find the new Excel file in your chosen destination and open it.
That’s it! You can now prepare and transform the raw data to carry out analysis.
Wasn’t that easy? Power Automate is Microsoft’s hidden gem, and there’s no doubt it’ll gain in popularity as the word spreads.
There are lots of features I haven’t explored yet, so I’m looking forward to discovering more ways to automate tasks.
For now, what will you be scraping?