Google spreadsheet, import from site with Jsp?

There is a link of type ec.europa.eu/taxation_customs/dds2/tra/transit_home.jsp?Lang=fi&MRN=15FI000000010520T8&Expand=true
The task is to pull the last date from the open list by means of holotable.
ImportHTML is responsible that there is a table there because the request to the JavaScript can not do, and about the same behavior and ImportXML.
I will be glad for any leads on the right way or crutches.
September 19th 19 at 00:10
1 answer
September 19th 19 at 00:12
Hello.

It's called something like "browser on server".
The idea is that we should force the server to load the page to cause all client procedures, to get the context and parse it, output to the network.
Problem:
  • Where to take/to start/to beg/to configure the server ordinary mortals?
  • What!?

Idea:
  • To organize a part of the automation in the workplace.
  • To publish data, aka the "output network", on Google Drive.

The steps:
  1. You need to download and unzip phantomjs.org/download.html Let folder file phantomjs.exe called
    'C:\phantomjs\bin'
  2. Need to download the file parse_jsp_to_file.js Save it there, where is the file phantomjs.exe
  3. You need to install Drive for Mac/PC
  4. You need to configure a folder on the disk to be shared (Visible to all on the Internet). Let's call it FOLDER.
  5. You want the folder synchronized FOLDER to the Drive for your Mac/PC. May her path be
    'SDK Google\FOLDER'
  6. To open a file parse_jsp_to_file.js with a text editor and modify the line
    var folder = 'C:\\_\\Google Drive:\\temp (main)\\(public)\\';

    on line
    var folder = 'SDK Google\\FOLDER\\';
    *watch out for the slashes. Setup shown is for Windows
  7. Remains to run the command line and paste there
    'C:\phantomjs\bin\phantomjs.exe parse_jsp_to_file.js'

  8. If the folder SDK Google\FOLDER has a file yyyy-mm-dd.xml then you can go further, otherwise, pick and check.
  9. You need to obtain the folder ID of FOLDER on Disk. This is the long combination of Numbers/Letters in the address sharing.
  10. You need to take the formula IMPORTXML() from a file goo.gl/GUpaf2
  11. You need to replace in this formula, ID is on your.
  12. All.

I have runs like a clock.
Problem:
  • I didn't put exception handlers.
  • JS file should be in UTF-8
  • I added a BAT file for configuration. But I C:\phantomjs\bin is in environment variables.

In the end:
  • BAT can be configured to run every day.
  • The files are written one for each day.
  • In Tables it is possible to track the date change context.


With respect.
More answers in Russian here Bit.Ly/rudrive and then Bit.Ly/rugoogleapps.

PS:
For many links, you just need to use another script simple_cycle.js. He needs the existence of the file file.txtwhere describes the parameters that should generate a URL for the request.
The result on the sheet "Example with multiple files" goo.gl/GUpaf2.
Thank you! Excellent, detailed response, but I just now realized that it was not correctly formulated a question: in the link part of the "15FI000000010520T8" is a variable, and the variable list in the table. - Roma commented on September 19th 19 at 00:15
Unfortunately, the outcome will be the same - you have to write the script for "Phantom" and form a data source, such as an XML document. - marcella.Lueilwitz14 commented on September 19th 19 at 00:18
Again, I'm not saying this is the best way, just now I work in the same direction. - marcella.Lueilwitz14 commented on September 19th 19 at 00:21

Find more questions by tags Google Sheets