This content originally appeared on DEV Community and was authored by Lyner Lim
Have you ever tried to download a file using curl or wget, only to end up with an HTML page instead? It’s likely that the URL isn’t pointing directly to the file. Let’s use downloading a file from GitHub as an example.
If you just click on the file like this link (https://github.com/docker/docker-install/blob/master/install.sh), right click to inspect and you will see it is in html.
What we should do is click on the Raw to get this link (https://raw.githubusercontent.com/docker/docker-install/refs/heads/master/install.sh).
Now, wget https://raw.githubusercontent.com/docker/docker-install/refs/heads/master/install.sh or curl -O https://raw.githubusercontent.com/docker/docker-install/refs/heads/master/install.sh will download the install.sh file to your local directory.
This content originally appeared on DEV Community and was authored by Lyner Lim
Lyner Lim | Sciencx (2024-10-26T01:40:20+00:00) Troubleshooting: curl/wget Fetching HTML Instead of Files. Retrieved from https://www.scien.cx/2024/10/26/troubleshooting-curl-wget-fetching-html-instead-of-files/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.