Home > Net >  google sheet importhtml with click show more
google sheet importhtml with click show more

Time:03-26

I'm trying to import NHL data from https://www.espn.com/nhl/stats/player/_/view/skating/table/offensive/sort/goals/dir/desc

The problem is that I can't import the 733 rows because of a "Show more" which make a little import of 51 rows. I'd like to import all 733 rows.

Here's the code that I put in a cell of my google sheet:

=IMPORTHTML("https://www.espn.com/nhl/stats/player/_/view/skating/table/offensive/sort/goals/dir/desc";"Table";2;)

Thanks for your time,

Vincent

CodePudding user response:

There's a similar question here.

Basically it is stated that if the data displayed is controlled by JavaScript, it is not possible to fetch the data using import() functions from Google Sheets.

In your case checking if the NHL data you want to retrieve is controlled by JavaScript I went to the URL, disabled JavaScript (by clicking on the padlock icon next to the URL in the URL bar > clicking on Site Settings > setting JavaScript to 'Block'> refreshing the website) when clicking on 'Show more' it did not show anything else, so the data is indeed controlled by JavaScript.

  • Related