downloading a web page with telnet
-
I am trying to download a web page with telnet. I used to do this back in around 1998, and it worked. I tried this at the command line on Windows 11: telnet www.example.com 80 Then I typed "GET /" and hit enter twice. However, it returns a 404 instead of the web site. Anyone know what's wrong? Thanks.
-
I am trying to download a web page with telnet. I used to do this back in around 1998, and it worked. I tried this at the command line on Windows 11: telnet www.example.com 80 Then I typed "GET /" and hit enter twice. However, it returns a 404 instead of the web site. Anyone know what's wrong? Thanks.
mike7411 wrote:
Anyone know what's wrong?
The forum where you asked. :) Try here[^]
M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
-
I am trying to download a web page with telnet. I used to do this back in around 1998, and it worked. I tried this at the command line on Windows 11: telnet www.example.com 80 Then I typed "GET /" and hit enter twice. However, it returns a 404 instead of the web site. Anyone know what's wrong? Thanks.
mike7411 wrote:
Anyone know what's wrong?
You're using the wrong tool. Try [GNU Wget 1.21.4 for Windows](https://eternallybored.org/misc/wget/) instead e.g. wget --output-file=example.com www.example.com assuming, of course that you're not prevented from adding software to your system You might also try [curl shipped by Microsoft](https://curl.se/windows/microsoft.html), but that processes the HTML. There might be a flag to give you the raw text, but I didn't see one in a brief perusal of the man page. Bonus: both handle HTTPS negotiations, so that might make up your mind, right there.
"A little song, a little dance, a little seltzer down your pants" Chuckles the clown
-
I am trying to download a web page with telnet. I used to do this back in around 1998, and it worked. I tried this at the command line on Windows 11: telnet www.example.com 80 Then I typed "GET /" and hit enter twice. However, it returns a 404 instead of the web site. Anyone know what's wrong? Thanks.
They dropped support for obsolete HTTP versions and your request isn't valid HTTP/1.1. Try:
GET / HTTP/1.1
Host: www.example.com -
I am trying to download a web page with telnet. I used to do this back in around 1998, and it worked. I tried this at the command line on Windows 11: telnet www.example.com 80 Then I typed "GET /" and hit enter twice. However, it returns a 404 instead of the web site. Anyone know what's wrong? Thanks.
You need a host header GET / HTTP/1.1 Host: example.com
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix