0

I know how to use the importhtml function of google spreadsheets but there is one webpage which refuses to load the table. Link given below.

https://www.dream11.com/cricket/fantasy-scorecard/1027/14047

I even tried the below code in google developer console to check the table index but this also did not solve var i = 1; [].forEach.call(document.getElementsByTagName("table"), function(x) { console.log(i++, x); });

Please help

Rubén
  • 34,714
  • 9
  • 70
  • 166
Sabha
  • 621
  • 10
  • 32

1 Answers1

1

To test whether a site is able to be used with IMPORTHTML, turn off javascript and load the page. If the content isn't there anymore, it's not actually part of the html and so it's not compatible with IMPORTHTML.

This is the case with your link—sorry. That table is populated after the fact and so it cannot be seen by Sheets.

Find a new source for that data.

Related: Google Sheets ImportHTML can't find table?

Joel Reid
  • 955
  • 1
  • 8
  • 14
  • Thanks for your reply. It definitely makes sense. I am not good at javascript and programming stuff. What I see from the webpage is that it is divided in two parts. Do you think there would be a different URL for the left side of the page? If yes, will it then be easier to importhtml? Thanks – Sabha Mar 25 '19 at 19:11
  • 1
    No. It's not a frame or canvas element—that table is inserted after the fact by javascript. That page is flatly incompatible with the way IMPORTHTML works and you'll need to use a different source. – Joel Reid Mar 25 '19 at 19:14
  • I understand... One last question.... Is there a way to scrape the info somehow. Can you suggest a source? – Sabha Mar 25 '19 at 19:16
  • No, sorry. I don't know anything about that data, and any other potential sources for it. I can imagine some… caching service you run on a computer, which loads and renders and re-serves the table to Google's importer, but I'd say anything of the sort would be MUCH more work that copying the data in a web browser and pasting it every time you use the spreadsheet. – Joel Reid Mar 25 '19 at 20:37
  • Thank you so much for your guidance and assistance. God bless ! – Sabha Mar 25 '19 at 21:06