Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am trying to scrape data from a website that has tabulated data generated and presented based on a selection made on the website.
Let's use the Fortune 500 website as an example of the challenge I am attemptign to overcome.
When you go to the website for 2021:
https://fortune.com/fortune500/2021/search/
you are presented with the top 10 companies by default.
These 10 results can easily be scraped using Web.BrowserContents, but you will notice there is a section at the bottom of the page that defines the display span.
You can select from 5 - 100 companies to display.
I have no html experience, I am an excel guy, so excuse me if there is an obvious solution here, but I can't work out if there is a way to modify this in Power Query prior to generating the html snapshot that the table extraction runs from.
Looking at the developer tools in Chrome, i can see that the table is generated in a section called <div class="ReactTable"> which is dependedent on the span set in the following html section:
<span class="select-wrap -pageSizeOptions">
<select aria-label="rows per page">
<option value="5">5 rows</option>
<option value="10">10 rows</option>
<option value="20">20 rows</option>
<option value="25">25 rows</option>
<option value="50">50 rows</option>
<option value="100">100 rows</option>
</select>
</span>
I can't seem to select a different span though once i am in the Add Table Using Examples wizard (even though there seems to be a button in the selector).
Therefore, I am wondering, is it possible to use a modifier like [WaitFor =] in Web.BrowserContents to define the span when first connecting to the website?
Hi @JasonC_XBI
It looks like a challenge as the URL doesn't change when we change the rows option and switch pages on the webpage. I find some old threads similar to your requirement. You may refer to below links to see whethe they can help in your scenario.
how to import website data including additional table pages under the same web address
Wordpress Tablepress multi-page table do not import all rows
All records from a table in a website not displaying
If the url will change when switching pages, you can refer to below article to extract data from multiple pages.
Scrape Data from Multiple Web Pages with Power Query
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
13 | |
8 | |
8 | |
7 |
User | Count |
---|---|
17 | |
13 | |
7 | |
6 | |
6 |