""" Some basic functionality for reading data from web pages, including https pages """ from urllib.request import urlopen import ssl def print_data(url): """ Prints the data of the webpage found at the provided URL :param url: (str) the URL of the webpage to print its data :return: (None) """ reader = urlopen(url) for line in reader: print(line) reader.close() def print_url_data(url): """ Prints the data of the webpage found at the provided URL :param url: (str) the URL of the webpage to print its data :return: (None) """ context = ssl._create_unverified_context() reader = urlopen(url, context=context) for line in reader: print(line.decode('ISO-8859-1').strip()) reader.close()