Python urllib Function


Python urllib module handles URL fetching and parsing.

urlopen method, retrieve URL page. For Example, to retrive "http://www.endmemo.com":

>>> import urllib.request
>>> r = urllib.request.urlopen("http://www.endmemo.com")
>>> rad = r.read()


urlretieve retrieve URL and store it in a temporary location:
>>> import urllib.request
>>> file, headers = urllib.request.urlretrieve("http://www.endmemo.com")
>>> rad = open(file)