''' Purpose: introduce web data acquisition -- print contents of http://www.cs.virginia.edu/~cs1112/datasets/words/most-misspelled ''' # need help to get web data - so import the capability from urllib.request import urlopen # specify the link of interest link = 'http://www.cs.virginia.edu/~cs1112/datasets/words/most-misspelled' # get a connection to stream the web resource of interest stream = urlopen( link ) # read stream to get the contents of the page content = stream.read() # decode contents into plain text form text = content.decode( 'UTF-8' ) # convert text into a list of lines ... # print lines one by one ...