Question: HTML Files Hypertext Markup Language is the basic language used for web pages. It is just a text file, so we can use python to

HTML Files Hypertext Markup Language is the basic language used for web pages. It is just a text file, so we can use python to read an html. The markup in html uses tags for sections and formatting. Tags have an opening and a closing tag. For instance, in the tag, there is normally a title tag that gives the title of the web page. Example A sample web page

This is a paragraph in the body.

The indentation in the above section is only for readability. There may not be any indentation. The important part. Headers The header tag in html indicates the head of a section, and has formatting to make it stand out before its section.

is the highest level, with lower tags

,

,

etc.

My Heading

Big section of information

Smaller sub heading

Big section of information

Another heading

Big section of information

Notice that the

section starts with

and the end is marked with

. Youll want open the html files as a text file and be able to read through them. Output Our program is going to read through the headers and output the headers in a new output file as a bullet point file. The output for the example above would be * My Heading * Smaller sub heading * Another Heading Your program will need to output, extra spaces or tabs to indent the values in the output file. Requirements Ask user for a valid input file. Must respond to File Not Found Error appropriately. Ask user for file to output to. Must respond to IO Errors appropriately. Read through input html file for any header tags and export the result as unordered lists to the output file. Example

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!