The urllib2 module provides an extensible framework for opening URLs on the Internet. Unlike the urllib module, urllib2 is capable of handling more complicated connection scenarios, including those involving HTTP cookies, redirection, and password authorization.
urllib2 defines the following functions:
urlopen(url [, data])
Opens the URL url and returns a file-like object that can be used to read the returned data. url may either be a string containing a URL or an instance of the Request class, described later. data is a URL-encoded string containing data to be uploaded to the server. When data is given, the HTTP ‘POST’ method is used instead of ‘GET’ (the default). Data is generally created using a function such as urllib.urlencode() ...