Networking and Internet Modules

urllib

Package grouping URL parsing, request handling, response wrappers, exceptions and robots.txt parsing. Select the appropriate submodule explicitly. Importing the package alone does not make every submodule available; parsing is separate from network access.

Formal Syntax & Structure

python syntaxpython
import urllib

Return Value

module

Module namespace available through import; import is a statement, not a value-returning expression.

Working Example

Example Snippetpython
from urllib import parseprint(parse.urlencode({"q": "green tea"}))
Python Reference