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

View all the Fabric Data Days sessions on demand. View schedule

Reply
J94
Helper I
Helper I

Extract data from website

Hi everyone,


I want to extract dividend data from the site dividendhistory. However, with underlying code, I am only able to extract a few rows instead of the whole table. And this stock has several pages without the website link is changing (see image below). How can the code be changed that it recognize everything? 

let Source =
Web.BrowserContents("https://dividendhistory.org/payout/KO/"),
ExtractedTable = Html.Table(Source, {{"Ex-Dividend Date", ".tabulator-cell[tabulator-field=""ex-dividend_date""]"}, {"Payout Date", ".tabulator-cell[tabulator-field=""payout_date""]"}, {"Cash Amount", ".tabulator-cell[tabulator-field=""cash_amount""]"}}, [RowSelector=".tabulator-row"]),
ChangeType = Table.TransformColumnTypes(ExtractedTable,{{"Ex-Dividend Date", type date}, {"Payout Date", type date}, {"Cash Amount", type text}}) in ChangeType

 

DividendSeveralPages.png

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

@J94 

 

That site is loading data with JavaScript so unfortunately you can't use Power Query to get the data.

 

PQ requires that the data can be retrieved with parameters that are supplied in the URL (or possibly in headers).  Unless the site API allows this you are stuck.

 

You could use somethign like Selenium to get the data but that requires further programming outside PQ.

 

There are webites that provide scraping as a service, you can search for them, but that will cost you and require integration into PQ.

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @J94 

I have inspected the site using the developer tool. Navigating to a page or changing the number of items creates a  post request which real API endpoint is unfortunately hidden behind a javascript. 

 

If you change the page size to 100 there will only be 3 pages so extracting the data manually shouldn't take that long.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
PhilipTreacy
Super User
Super User

@J94 

 

That site is loading data with JavaScript so unfortunately you can't use Power Query to get the data.

 

PQ requires that the data can be retrieved with parameters that are supplied in the URL (or possibly in headers).  Unless the site API allows this you are stuck.

 

You could use somethign like Selenium to get the data but that requires further programming outside PQ.

 

There are webites that provide scraping as a service, you can search for them, but that will cost you and require integration into PQ.

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


AliceW
Power Participant
Power Participant

J, I had a similar problem and I used Grok to give me the precise answer. It worked.

Try it yourself.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors