I used to scrape some data from a website onto a google sheet using importhtml(URL, "table", INDEX)
. But recently, website changed from displaying the data in a table, to displaying it as a class = card
element. Is there still some way to import the data from that card to a google sheet? Perhaps with a script?
Concrete example: using =IMPORTHTML("https://www.marketscreener.com/quote/stock/APPLE-INC-4849/consensus/","table",0)
in a google sheets cell would import a table with Analysts’ consensus data, but no it does not work any more.
2
Answers
For this issue, you should come up with some script that will scrap your data on whether the website pattern changes or not.
You can have some exemplary scripts to have a look at how to write your own script.
This will also be helpful for you.
After finalizing the script add that in your
Google Sheets Extensions
where you find App scripts edit them like replacing your code with the present one. Save your script and start running it. It will work perfectly.Here’s one approach you may test out: