Problem with wget

Somehow I broke wget on my local instance when it connects to my AWS instance. No matter the file wget only downloads the login page for the jupyter notebooks even though I logged into the server. I tried downloading different files, I looked at wget tutorials and tried to pass in the notebook password with the --password flag (with and w/o the --post-data flag; tried to give it the password via --save-cookies with the --post-data. I run ubuntu 14, and I think wget was already installed.

What’s odd is that wget was working fine when I needed to download files off my AWS instance to work locally last week perfectly fine, but i’m not sure what changed. here’s the headers from my latest attempt to use wget of my AWS instance

I think the problem may be with the “Location” header? but i’m unsure how to fix the
any help would be appreciated!

Here’s a sample of what wget is grabbing instead of a python file

IIRC posting the form sends a 302 redirect, which wget doesn’t follow automatically (perhaps it did in an earlier version?). So you need to use the cookies to re-request.

wget --load-cookies cookies.txt

^^ that should work when you run it right after doing a fresh command like the one in your screenshot

1 Like

thanks for the tip @nunb! this was driving me crazy over the weekend!