Question: Write a python program that prompts the user for a web address (full url, html page) and then uses the BeautifulSoup and urllib to read

Write a python program that prompts the user for a web address (full url, html page) and then uses the BeautifulSoup and urllib to read its data.

You can use the any html page you'd like:

The program should output the following:

  1. The page title (hint: read the content from the metatag "title")
  2. The total number of words on the page
  3. The total number of unique words on the page
  4. The total number of each heading used on the page (hint: count the number of "H1"-"H6" header tags used on the page)
  5. The total number of paragraphs on the page (hint: use the

    tag to count)

  6. The total number of links on the page
  7. After outputting, the program should ask the users if they would like to parse another web address or quit.
  8. Use at least 3 web addresses to check your program. List their urls as comments in the beginning of your program.

Remember:

  • Only use the material covered in this module -- do not use more advanced functions not covered yet in the course
  • Make sure to include comments that explain all your steps (starts with #). Also use a comment to sign your name at the beginning of the program!
  • Work individually and only submit original work
  • Run the program a few times to make sure it executes and meets all the requirements
  • Submit a .py file!

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 Programming Questions!