Linux – Download a file from the shell when button click is required

curllinuxshellwget

I have a link to a file that I would like to download from the shell. Unfortunately, the URL redirects to a software license agreement page which requires clicking an accept button. This is fine when I'm in a standard browser but when I'm in the shell wget will just download the html page and not the actual file. What options are available to download the file to the shell when the terms must first be accepted?

Specifically, I'm looking at the following LSI download page:

http://www.lsi.com/Pages/user/eula.aspx?file=http%3a%2f%2fwww.lsi.com%2fdownloads%2fPublic%2fSATA%2fSATA%2520Common%2520Files%2f3DM2_CLI-Linux_10.2.1_9.5.4.zip&Source=http%3a%2f%2fwww.lsi.com%2fdownloads

I did view the source code on the page and found a link to the following location but it also pulls up the eula page when using wget.

http://www.lsi.com/downloads/Public/SATA/SATA%20Common%20Files/3DM2_CLI-Linux_10.2.1_9.5.4.zip

So far the only options I have come up with is to:

  1. Download it to a different machine that has a browser and then upload it to the server that only has a shell. Slow and painful.
  2. Install something like Lynx. I'm not sure if Lynx handles downloads well and don't love the idea of installing extra software on a production server.
  3. Continue analyzing the EULA code to determine how it is preventing my download (assuming it is javascript and not server side).

There has got to be an easier way?

Best Answer

I typically just use lynx for this. Take a moment and familiarize yourself with the navigation keys. The download process is straightforward and allows you to select the output location...

However, in this case, I tried to run the download through lynx, but had no luck.

So just take the resulting filename, 3DM2_CLI-Linux_10.2.1_9.5.4.zip, and search for an alternate source that will allow you to wget. Easiest approach.