Reputation: 13
I'm trying to scrape stock quotes from web pages using Google sheets and ImportHTML (and its variants like ImportXML and ImportData). It works on some web pages but not others. An example of a web page I'm unable to import data from is https://www.barchart.com/stocks/performance/price-change/advances.
I used the following code:
=IMPORTHTML("https://www.barchart.com/stocks/performance/price-change/advances","table",0)
. Is there a way to download or scrape this data?
Upvotes: 1
Views: 1402
Reputation: 38150
Tl;Dr IMPORTHMTL, IMPORTXML and IMPORTDATA can't import data from the referred webpage because it requires JavaScript be enable on the web browser.
The first two requires that the HTML be well formed, they can't get data from dynamic pages.
Reference
Upvotes: 1
Reputation: 384
You have other options. You can write a simple script in any language for web scraping, using python or JS, or try the barchart API, its free.
https://www.barchart.com/ondemand/free-market-data-api
Upvotes: 2