r/GoogleAppsScript • u/VAer1 • Sep 06 '25
Question How to automatically import data from webpage to Google Sheet?
https://finance.yahoo.com/calendar/earnings?from=2025-09-07&to=2025-09-13&day=2025-09-08
Is there a way to import stock earning report calendar (for the next few days) from webpage to Google Sheet?
It can be from Yahoo Finance or other data source.
If from Yahoo Finance, I should use https://finance.yahoo.com/calendar/earnings?day=2025-09-09&offset=0&size=100 for first 100 data rows, https://finance.yahoo.com/calendar/earnings?day=2025-09-09&offset=1&size=100 for second 100 data rows, etc. It depends, sometimes there are more than 100 earning reports scheduled within one day during earning report season.
1
u/arnoldsomen Sep 06 '25
I've done something similar, so yeah, it's possible.
Apps script extracted data from these then imported all to a Gsheets.
1
u/WicketTheQuerent Sep 06 '25
First, please look at the page source for the data you want to import (right-click > See page source code). If it's there, you can retrieve the page source code using the UrlFetchApp service. Then, you should parse the data. The specific way depends on how the data is placed in the page source code.