There is this link: https://covid19.who.int/table
COVID 19 table view
It is a table with latest COVID 19 cases.
I tried getting the results in a spreadsheet using a formula
=IMPORTHTML("https://covid19.who.int/table","table",1)
It gives the error:
Error Imported content is empty.
How can I make it work? What is wrong?
When I do "inspect" it says <div role="table" class="sc-pBzUF dgtvEZ"
try this instead
=IMPORTDATA("https://covid19.who.int/WHO-COVID-19-global-table-data.csv",",","en_US")
Related
Right now I am scraping certain Productinformation from bol.com.
The product data is getting scraped. But for each 30 products, about 5 are either scraping incomplete data, for instance the EAN is missing, while its in the same content block as normal or it just gives N/A. While there is information.
Any tips?
Ps. This is my current formula: =importxml(C27;"//*[#id='mainContent']/div/div[1]/div[5]/div[1]/div[4]/div/div/div[1]/div/div[1]/dl")
C27 is the URL. (https://www.bol.com/nl/nl/p/adroitgoods-hondenriem-180-cm-hondenlijn-looplijn-hondenlijn-reflecterend-rood-lange-lijn-hond/9300000101425619/)
It should import the following product information:
EAN
Kleur
Materiaal
Maat
Reflecterend
Speciaal voor hardlopen
Type uitlaatriem
Verpakkingsinhoud
try:
=INDEX(TRIM(IMPORTxML(A1, "//dl[#class='specs__list']/div")))
I'm trying to use the IMPORTDATA function in Google Sheets to download stats from baseball-reference.com.
For example, if I want the Team Standard Batting table from:
https://www.baseball-reference.com/leagues/MLB/2020.shtml
I click on the "Share & more" > "Copy Link to Table to Clipboard" to get:
https://www.baseball-reference.com/leagues/MLB/2020.shtml#teams_standard_batting
Then, in A1 of my otherwise empty Google Sheet, I'm inputting:
=IMPORTDATA("https://www.baseball-reference.com/leagues/MLB/2020.shtml#teams_standard_batting")
however, I'm getting #REF with the following error message:
"Result was not automatically expanded, please insert more columns (86)."
IMPORTDATA needs to be almost always restricted
try for starters:
=ARRAY_CONSTRAIN(IMPORTDATA("https://www.baseball-reference.com/leagues/MLB/2020.shtml#teams_standard_batting"); 5000; 20)
this will import you the source code of that site.
update:
try:
=IMPORTHTML("https://www.baseball-reference.com/leagues/MLB/2020.shtml#teams_standard_batting",
"table", 1)
You need to add another 86 columns, like the warning is telling you
I'm trying to get the seperate <td>'s to show up in Google Sheet of a <tr> that I'm importing through IMPORTXML.
This code should get my match data based on the match ID I provide, and my player ID. I feel that simply adding /* or /td to end of Xpath should work, but that's the end of my knowledge.
I tried: adding /*, /td and other to end of xPath Query but doesn't seem to work.
Even disabled JavaScript and inspected website again but to no avail.
FORMULA:
=IMPORTXML("https://www.dotabuff.com/matches/5011379854";"//tr[contains(#class,'9764136')]")
Also tried:
=IMPORTXML("https://www.dotabuff.com/matches/5011379854";"//td[parent::tr[contains(#class,'9764136')]]")
Which only gives the first of all the /td's and not the rest.
Current outputis all mushed together:
"19LemthTop (Off)ZeusCoreTop (Off) Roaminglost27108.7k127933650626.5k-183-/-5m7m21m31m"
The output that I want is separate <td> on separate lines:
"19
LemthTop (Off)ZeusCoreTop (Off) Roaminglost
2
7
10
8.7k
127
9
336
506
26.5k
-
183
-/-
5m7m21m31m"
Issue and workaround:
Although I have tried to parse the values for each row, unfortunately, it seemed that td cannot be directly parsed using a xpath with IMPORTXML as each row. But fortunately, each table can be retrieved by IMPORTHTML and also each tab can be accessed. Using them, how about the following workaround?
Retrieve a table from the URL using IMPORTHTML.
Retrieve a row including the name corresponding to 9764136 you want using a query.
Modified formula:
=TRANSPOSE(SPLIT(TEXTJOIN("#",TRUE,QUERY(IMPORTHTML(A1,"table",1), "where Col4 contains '"&IMPORTXML(A1,"//a[contains(#href,'9764136')]")&"'", 0)),"#",TRUE,TRUE))
The URL of https://www.dotabuff.com/matches/5011379854 is put to the cell "A1".
After the table was retrieved, the row is retrieved from the table by the query.
The important point of this workaround is the methodology. I think that there are various formulas for retrieving the value. So please think of above sample formula as just one of them.
Result:
Note:
If you use above formula for other URL, an error might occur. Please be careful this.
References:
IMPORTHTML
IMPORTXML
TEXTJOIN
SPLIT
TRANSPOSE
I'm importing some data with importXML into a google sheet, but I need to have another ImportXML (with different regexp) when the first display "#N\D". I have tried with if.error but nothing, same with if IMPORTXML(....)="#N\D".
What Can I do?
thx
Instead of
IMPORTXML(meta!B1; "//*[#title='atto'][1]/div[2]/div[4]/a/#href")="#N\D"
try
ISERROR(IMPORTXML(meta!B1; "//*[#title='atto'][1]/div[2]/div[4]/a/#href"))
or
IMPORTXML(meta!B1; "//*[#title='atto'][1]/div[2]/div[4]/a/#href")=NA()
I'm having some trouble using the SPARKLINE function on Google Spreasheets. If I use the "default" formula, like =SPARKLINE(C9:N9), it works nicelly. But, everytime I try to add some extra options, like using columns instead of lines, for example =SPARKLINE(C11:N11;{"charttype", "bar"}), I get a "Error, Formula parse error." message.
Has anyone here had the same problem? Any idea of how can I fix it?
Thanks!
From https://productforums.google.com/forum/#!topic/docs/QzVhyW5bi-A
When you address the option like an object, then you should use a backslash: =SPARKLINE(C11:N11;{"charttype"\"bar"}