March 2019
Beginner
490 pages
12h 40m
English
Uniform Resource Locators (URLs) are fundamental to the way in which the web operates, and are formally described in RFC 3986. A URL represents a resource on a given host. URLs can point to files on the server, or the resources may be dynamically generated when a request is received.
Python uses the urllib.parse module for working with URLs. Let's use Python to break a URL into its component parts:
>>> from urllib.parse import urlparse >>> result = urlparse('https://www.packtpub.com/tech/Python') >>> result ParseResult(scheme='http', netloc='www.packtpub.com', path='/tech/Python', params='', query='', fragment='')
The urllib.parse.urlparse() function interprets our URL and recognizes HTTP as the scheme, www.packtpub.com ...
Read now
Unlock full access