Search code examples
javascriptubuntu-16.04wgetrhino

Downloading XLS from URL


I'm trying to pull data, using an Ubuntu 16.04LTS server, from a website that uses JavaScript to export data into an XLS file.

https://www.adfg.alaska.gov/sf/FishCounts/index.cfm?ADFG=main.displayResults

Has a link called Export as Excel Spreadsheet which gives you this link here

https://www.adfg.alaska.gov/sf/FishCounts/index.cfm?ADFG=export.excel&countLocationID=40&year=2017&speciesID=420

I tried using the command user$ wget rhino -weblink- but it compiles with errors 79 Errors.

I don't know very much about programming, I'm just trying to automatically pull the data on a daily basis, and run a BASH script that calculates data from the spreadsheet for me.


Solution

  • Norrin

    That URL worked properly without JS execution. Here is the command that I use:

    curl -L -o FishCount.xls 'https://www.adfg.alaska.gov/sf/FishCounts/index.cfm?ADFG=export.excel&countLocationID=40&year=2017&speciesID=420'

    Be careful that use the single-quote to wrap URL. Otherwise BASH/SHELL will misinterpret & as background process.