URLLib (Python Internet Protocol Library)

Introduction

urllib is a Python Standard Library package that collects several modules for working with URLs:

Requesting Data from URL

Here is a simple example of using urllib.request to request the HTML for MIT's Course Catalog.

import urllib.request
import json
# request json file
url = 'http://student.mit.edu/catalog/m1a.html'
response = urllib.request.urlopen(url).read()
data = response.decode('utf-8')
# write to console
print(data)

References

Web Links

Note Links