''' Purpose: print contents of a user-indicated web page ''' # need help to get web data - so import the capability from urllib.request import urlopen # get url link of interest reply = input( "Enter url: " ) # clean up the reply link = reply.strip() # 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" ) # get the lines that make up the text lines = text.split( "\n" ) # print the lines one by one for line in lines : print( line )