Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join 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.

Reply
JasonC_XBI
Advocate II
Advocate II

Modifying default website settings when using Web.BrowserContents

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?

1 REPLY 1
v-jingzhang
Community Support
Community Support

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.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.