Write a third function that will read the first few words


Problem

I. Write a function which will take a single string argument. The purpose of the function is to take a simple URL like and turn it into a fully qualified URL then test the URL to ensure it is accessible. If it is accessible print "URL valid" and return the fully qualified URL to the caller. If the URL is not accessible, return "ERROR" to the caller.

II. Write a second function which will take a single string argument. Based upon the string argument - open the associated web page and read the HTML code of the webpage, append todays date and time to the contents and save it to your computer as a text file.

III. Write a third function that will read the first few words of a text file and return them to the caller. (Research variations of the read method.)

IV. Write a script that asks the user for a simple URL. If the user does not provide a URL that is accessible ask them again for a valid URL. They only get three attempts to provide a valid URL. After the third failed attempt the program will end with an appropriate message. If a valid URL is provided write the contents of the webpage to a file print to the screen the first few words of the file and on another line the message "File Successfully Saved.

"Do not duplicate function code - in the script (step 4) you should practice code re-use by invoking functions that you wrote to accomplish this task.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a third function that will read the first few words
Reference No:- TGS03276216

Expected delivery within 24 Hours