This document is for an old version of Python that is no longer supported. You should upgrade, and read the Python documentation for the current stable release.

# `urllib` — URL handling modules

Source code: Lib/urllib/

`urllib` is a package that collects several modules for working with URLs:

- `urllib.request` for opening and reading URLs

- `urllib.error` containing the exceptions raised by `urllib.request`

- `urllib.parse` for parsing URLs

- `urllib.robotparser` for parsing `robots.txt` files