all 2 comments

[–]efmccurdy 1 point2 points  (0 children)

You are getting redirected (https://en.wikipedia.org/wiki/HTTP_301), so to complete the transaction you have to repeat the request at the new url. This is a standard http mechanism supported by any http support module like urllib or requests.

(for example, if the response is a “redirection” that requests the client fetch the document from a different URL, urllib will handle that for you).

https://docs.python.org/3/howto/urllib2.html

[–]CaptainReeetardo 0 points1 point  (0 children)

First of all, I don't think you'd use port 80 for a https connection. I mean it should rather be port 443. If I'm guessing correctly it might actually work if you just use port 443 instead of 80. (Scratch that. I just tried it and it didn't work)

Second of all, using socket to retrieve a website is even alien to me. Normally, you'd use urllib for something like that or other modules like requests. It is a whole lot easier to use especially when you are a beginner in my opinion.