Getting 'Imported content is empty' on IMPORTXML for Google Sheets, but path is correct

189 Views Asked by At

I'm trying to scrape data from https://www.sports-reference.com/cbb/schools/indiana/2019.html using Google Sheets IMPORTXML

In cell A1 I have the url: https://www.sports-reference.com/cbb/schools/indiana/2019.html

In cell A3, I have //div[@id='all_totals']. This returns the contents of the entire table with the id of all_totals, which is great. But I want to return the data more granularly, by row.

Using ChroPath on the Chrome browser, I identified the data I want to be at //div[@id='all_totals']//tr[@data-row='0']//td[1]. This means (I think), get the table with the id of all_totals and drill down to the first row and the second data cell. This returns "N/A" "Error: Imported content is empty".

I get the same result with //div[@id='all_totals']//tr[@data-row='0']

Anyone know what I'm doing wrong?

1

There are 1 best solutions below

0
pnuts On

Please, if your formula is in C1, try:

=transpose(split(C1,char(10)))

(Sorry, misread cfb for cbb.)