I've been searching for an easy-to-understand tutorial on fetching web pages using sockets in Python, but haven't been able to find a really newbie-friendly guide.

Could someone point me in the right direction?

9 Years
Discussion Span
Last Post by siddhant3s

Yes. First you need to learn the Basic HTTP protocol. Here(http://www.jmarshall.com/easy/http/) is excellent tutorial for the same. It teaches the protocol by using telnet. Then you should learn about sockets (http://docs.python.org/library/socket.html). Also, read the Beej's Network Programming Tutorial (http://beej.us/guide/bgnet/) it would be helpful, although it is intended for C programmers.
Next use socket's send and receive functions to interact with the web server as you would do with a telnet program.

But I strongly don't recommend you to do all this fuss. UrlLib along with urlLib2 is very powerful library. It can do many things. Use it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.