networked programs http/ ok datewed apr : : gmt serverapache(ubuntulast-modifiedmon may : : gmt etag" - accept-rangesbytes content-length varyaccept-encoding cache-controlmax-age= no-cacheno-storemust-revalidate pragmano-cache expireswed jan : : gmt connectionclose content-typeimage/jpeg now other than the first and last calls to recv()we now get characters each time we ask for new data there is buffer between the server making send(requests and our application making recv(requests when we run the program with the delay in placeat some point the server might fill up the buffer in the socket and be forced to pause until our program starts to empty the buffer the pausing of either the sending application or the receiving application is called "flow control retrieving web pages with urllib while we can manually send and receive data over http using the socket librarythere is much simpler way to perform this common task in python by using the urllib library using urllibyou can treat web page much like file you simply indicate which web page you would like to retrieve and urllib handles all of the http protocol and header details the equivalent code to read the romeo txt file from the web using urllib is as followsimport urllib request fhand urllib request urlopen('for line in fhandprint(line decode(strip()codeonce the web page has been opened with urllib urlopenwe can treat it like file and read through it using for loop when the program runswe only see the output of the contents of the file the headers are still sentbut the urllib code consumes the headers and only returns the data to us