# sample web page source downloader using python from socket import * # create and open a client-side TCP socket to a server and port: cfd = socket(AF_INET, SOCK_STREAM) cfd.connect(("www.cs.hofstra.edu", 80)) cfd.send("GET /index.html\n") # loop to read as much data as possible. data = "abc" # make sure data is not initially null while data: data = cfd.recv(1400) # read up to 1400 bytes at a time print data cfd.close() print "download complete\n"