0

I am trying to get the total distance (23,596) cell from the Away Games table fom this webpage into google sheets:

https://www.pro-football-reference.com/teams/nwe/2022_travel.htm

I am not able to import the cell properly using either IMPORTXML or IMPORTHTML

I looked at source code of the page and tried to specify the class and/or the tagging of the specific cell but I wasn't able to get the right cell.

These are two examples of what I tried

=IMPORTXML("https://www.pro-football-reference.com/teams/nwe/2022_travel.htm", "[@id="total_mileage"]")
=IMPORTXML("https://www.pro-football-reference.com/teams/nwe/2022_travel.htm", "//td[@class='right iz']")

For everything I tried, I either got an error or an "NA" result.

Rubén
  • 34,714
  • 9
  • 70
  • 166
eiad77
  • 1
  • 1
    The distances are calculated dynamically by a piece of javascript within the HTML code, this is why the IMPORTXML/IMPORTHTML is blank. There is nothing for it to return because it's only calculated after the page loads. – childnick Jan 04 '23 at 15:19
  • @childnick - thanks that makes sense. Is there any way I can do what I want? – eiad77 Jan 04 '23 at 15:31
  • Not exactly the same but see here (make a copy) https://docs.google.com/spreadsheets/d/1_3kIXZ6Yu3ZLvUaNJsyUB_vyB4UA6tZKq8xx9G9nNEo/edit?usp=sharing – childnick Jan 05 '23 at 17:41

0 Answers0