Internet functionality
Working with URLs
import urllib.parse
sample_url = "https://www.google.com/search?q=python"
parsed_url = urllib.parse.urlparse(sample_url)
print(parsed_url)
print(parsed_url.scheme)
print(parsed_url.hostname)
print(parsed_url.path)ParseResult(scheme='https', netloc='www.google.com', path='/search', params='', query='q=python', fragment='')
https
www.google.com
/searchsample_string = "Hello El Niño!"
print(urllib.parse.quote(sample_string))
print(urllib.parse.quote_plus(sample_string))Retrieving internet data
Parsing HTML
Using JSON
Last updated