''' Purpose: print contents of a user-indicated web page ''' # get url link of interest reply = input( "Enter url: " ) ############### BOILERPLATE TO GET CONTENTS OF WEB FILE ############### # need help to get web data - so import the capability from urllib.request import urlopen # clean up the reply link = reply.strip() # get a connection to stream the web resource of interest stream = urlopen( link ) # read stream to gets its encoded contents page = stream.read() # decode page into plain text form text = page.decode() ############### END OF BOILERPLATE ############### # the above code is tedious, need a function to do take care this crud import url text = url.get_contents( link ) # now let's get the lines that make up the text ... # print the lines one by one ...