-1

In a google sheets I try to read and import a table with this command:

=importhtml("https://www.hermesairports.com/flight-info/pafos/arrivals-and-departures"; "table"; 2)

result is:

#N/A

How i read the table with departures flights of the day in website https://www.hermesairports.com/flight-info/pafos/arrivals-and-departures ?

Rubén
  • 34,714
  • 9
  • 70
  • 166

1 Answers1

1

Your query is correct, but =IMPORTHTML can only import plain text, not Javascript contents

You can easily verify that the table you are interested is Javascript content by

  • Going on the websote https://www.hermesairports.com/flight-info/pafos/arrivals-and-departures
  • Click on the "lock" left from the address bar to view site permissions
  • The steps are slightly different depending on your browser, for Google Chrome:
  • Go on Permissions -> Javascript
  • Change the dropdown vlaue to Block
  • erfresh the Website

All content you cannot view when blocking Javascript is the content that you cannot import with =IMPORTHTML.

ziganotschka
  • 25,866
  • 2
  • 16
  • 33
  • Is already Permissions -> Javascript > Always If change to Block then cannot view the table at website. – Petros Andrianos Sep 28 '20 at 12:20
  • Taht's exactly what I mean! If you cannot view the table, it is a prove that the table inserted with Javascript. If a table is inserted with Javascript, unfortunately IT IS NOT POSSIBLE to import it with `=IMPORTHTML`. – ziganotschka Sep 28 '20 at 12:23
  • Then how can i import a table from javascript in to google sheets? Anyone know about this? – Petros Andrianos Sep 28 '20 at 14:26
  • A reason why websites inject table through Javascript is mostly because they don't want you to use their data outside of the website... If they have an API, you might be able to obtain the data programmaticaly (not necessary for free). Otherwise, you can certainly manually select the text from the website UI and paste it into sheets - not a very elegant solution. – ziganotschka Sep 28 '20 at 14:38
  • Any chance we make with bash or python script this manually select the text from the website UI and paste it into sheets? – Petros Andrianos Sep 29 '20 at 14:21