I'm struggling to import data from the barchart.com website
I have tried importing the data presented on barchart.com/stocks/sectors/rankings?timeFrame=matrix without success.
I have tried using IMPORTHTML and IMPORTXML but neither works and I've tried various inputs.
If someone can please assist.
this won't be possible. values which you want to scrape are controlled by JavaScript and Google Sheets does not support JS scraping. you can always test this by temporarily disabling JS on given URL to see what's possible to scrape:
Related
Essentially I'm working on a presentation and I would like to import this graph into google sheets it does not have to look the same I just need the data. I don't program in HTML so I'm not really sure what to do does anyone have ideas on how I could extract this graph data.
https://digitalik.net/btc/sf_model/#
I've tried using google sheets built-in HTML graph function but for some reason, it can't detect it so an alternative would be to download the data as an XML and paste it into sheets so that's also an option.
unfortunately not possible for a given site because it uses JavaScript and Google Sheets does not support web scraping of JS elements. you can test this simply by disabling JS for a given site and what's left can be scraped. in your case its nothing:
I'm trying to import stock suggestions into a spreadsheet and have successfully done so from 3 websites, but I am struggling with the 4th.
=IMPORTXML("https://www.tipranks.com/stocks/amzn/price-target","//h3[#class='client-components-stock-research-analysts-analyst-consensus-style__buy'")
Is the command I'm using to try to pull the tag under "Analyst Consensus Rating" from https://www.tipranks.com/stocks/amzn/price-target. But I keep getting:
Error Imported XML content can not be parsed.``` Tips for what I'm doing wrong would be highly appreciated
Google Sheets does not support web scraping of JavaScript controlled elements. you can easily check it by disabling JS for a given site and only what's left visible can be scraped. unfortunately, in your case, that's nothing:
I want to import table shows in below link:
https://www.codal.ir/ReportList.aspx?search&LetterType=6&AuditorRef=-1&PageNumber=1&Audited&NotAudited&IsNotAudited=false&Childs=false&Mains&Publisher=false&CompanyState=0&Category=1&CompanyType=1&Consolidatable&NotConsolidatable=false
it is not possible by importhtml, and I have tried some xpaths by importxml but failed.
this is not an issue of XPath. the website you are trying to scrape is dependant on JavaScript. Google Sheets does not support import of JS elements. your only option is to find the same data you need on some other website. you can test the JS dependency simply by disabling it for a given site and what's left of it can be scraped - in your case, nothing:
I'm trying to import the table of Fortune 500 companies for 2019 into Sheets. I've tried the formula
=IMPORTXML("https://fortune.com/fortune500/2019/search/","//div[#class='ReactTable']")
and some variations of this function but can't get it correct. Any help please?
the website you trying to scrape is under JavaScript control. Google Sheets is not capable of importing JS elements. you can test this simply by disabling JavaScript for a given site and what you are left with is able to be scraped. in your case: nothing:
This question already has answers here:
Scraping data to Google Sheets from a website that uses JavaScript
(2 answers)
Closed last month.
I would like to import the table on this website http://www1.hket.com/store/general/finance/web/hsioptions_day.html
and have it automatically update.
I have tried several ways to import the table to the sheets using
importhtml("http://www1.hket.com/store/general/finance/web/hsioptions_day.html","table",1)
But it seems it is not a table.
I also tried to import the table using
importxml("http://www1.hket.com/store/general/finance/web/hsioptions_day.html",A1)
as the XPath contains double quote I define cell A1 = //*[#id="table1"]/table
But it seems the XPath is wrong and it doesn't work. I've got an empty content error.
I wonder if anyone could help me to import the table properly into the sheet. Once it can be properly imported, I will try using the google script to update it automatically, using this tutorial
https://www.youtube.com/watch?v=ijaj7CXSg-Q&ab_channel=ArgentEngineering
Would anyone give some ideas to me how to properly import this table to the sheet?
I am an absolute noob in this and any help is appreciated.
I fear this won't work, your page is built with Javascript, which isn't supported by IMPORTXML (or by Google Sheets in general).
all you can scrape from this site is:
=IMPORTXML("http://www1.hket.com/store/general/finance/web/hsioptions_day.html", "//*")
and/or also this:
=IMPORTDATA("http://www1.hket.com/store/general/finance/web/hsioptions_day.html")
as already mentioned Google Sheets can't handle websites controlled via JavaScript