{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Project 3 - Project 3 Mastering HTML This is a team project...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Project 3: Mastering HTML This is a team project to be done in groups of at most 3 students Project Due Friday, December 10th, 11:59 pm TA: Mohammad Kazi ([email protected]) Background and Course Material Setup Project Specification Final Project Turnin Grading Criteria Background For this project you will develop a couple of functions in Python using the different concepts and functions which you have learnt during the course of the semester. Here is a gist of the main topics relevant to this project: Creating and Modifying Text (Chapter 10) Advanced Web Techniques (Chapter 11) HTML (Chapter 12) Setup 1. Remember to make a new directory for project3 under the directory CS177. 2. Download the file project3.py under the project3 directory. 3. Under the project3 directory, download the following files for use during this project: o TODO2.txt o TODO2_1.txt 4. Then launch JES and open the program project3.py provided to you and start working on it. Project Specification Overview For this project, you need to develop functions that read HTML pages, search for some specific content within these pages, modify such pages as well as generate such pages themselves. The project3.py This file contains a commented skeleton code for the functions that you are required to implement. Work on this file. Do not change the file name, and the given function names. TO DO #1 - C o l o r f u l l y Replacing Text in a Web Page In this TO DO, you have to replace all the occurrences of a particular word in the web page referenced by the url given as the input parameter with another word. This new word should have a specific color as per the user's choice. Implement this by filling in
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
the code for the following function: changeColorofText(url, original_word, new_color, new_word) In this function, the url specifies some URL on the internet which you will be accessing, reading and modifying in this function. original_word is the string you have to search for in the webpage corresponding to the url passed to the function. You have to replace all the occurrences of the original_word in the webpage with the string contained in new_word . While replacing the occurrences, you also have to ensure that each occurrence of the new_word is of the color specified by the new_color . newcolor should contain a color value as used in the standard HTML representation. The example below explains what this means. Once you replace all the occurrences with the appropriate color modifications, you need to save this modified data into a file "TODO1_output.htm" in the project3 folder. Here is an example demonstrating what the function should do ideally: changeColorofText( "http://www.cs.purdue.edu" , "Department", "#00FFFF", "College") The correct output for this function call is Sample_TODO1_output.htm Look at this output file carefully . Only those occurrences of "College" change their color which had replaced occurrences of "Department" in the original web page. The occurrences
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}