1. Write a Python program named LastnameFirstname13.py, using your last name and your first name, that does the following:

  • Scrapes data from a webpage, then stores the cleaned data into a separate .txt file.
  • Create a write_file function, which will:
    • Remove any unnecessary tags from the scraped data
    • Write the data to a separate file
    • Print a confirmation message
  • Create a main function, in which you:
    • Begin by printing a detailed description of what webpage you will access and what information you will scrape from the website. Note: for this assignment, please limit the amount of data you get! Try to retrieve at least 5, but no more than 250 elements.
    • Use the requests module to download a webpage
    • Use the Beautiful Soup module and the select method to scrape specific information from the website
    • Pass your data to the write_file function
  • All code in your program must be inside of a function definition, aside from import statements and calling main.
  • You may only call main once.

2. Be sure to add comments for each section of your code.

3. Your output must be descriptive. Make sure it's clear to the user what your program is doing.

Expected Output

>>>
=============== RESTART: ManuelNikki13.py ===============

Hello! This program will access the Hana Tea menu website at:
https://www.hanatea808.com/special-menu
This program will gather all the menu item names, for example:
Jasmine Milk Tea
Oolong Milk Tea
Passionfruit Yuzu (green/black tea)
It will do this by looking for elements in the website that are
between
tags with the menu-item-title class attribute.

Now downloading the HTML file...

Retrieved 59 elements that meet the criteria...

*** Hana Tea Menu Items ***
Honey Genmai Milk Tea (New)
Hong Kong-style Milk Tea
Brown Sugar Milk Tea
Thai Milk Tea
Oolong Milk Tea
Jasmine Milk Tea
Classic Milk Tea
Coffee Milk Tea
Brown Sugar Milk
Matcha Latte
Chocolate Latte
Espresso (Doppio)
Latte
Mocha
Watermelon Grapefruit Smash
Mango Black Tea (Seasonal)
Peach Green Tea Lemonade
Lemon Black Tea
Pineapple Black Tea
Kumquat Lemon (green/black tea)
Passionfruit Yuzu (green/black tea)
Fruit Party with (green/black tea)
Guava Passionfruit Tea (Oolong tea)
Winter-melon Mint Oolong tea
vita-C Orange tea (black/ peach green/ oolong tea)
Peach Green Tea
Black Tea
Honey Green Tea
Oolong Tea
Mango strawberry smoothies
Avocado banana smoothies
Acai smoothies
Peach smoothies
Chocolate banana smoothies
Strawberry smoothies
Watermelon smoothies
Pineapple smoothies
Fruit Party Sparkling Water
Strawberry Sparkling Water
Pineapple Sparkling Water
Lemon Sparkling Water
Blueberry Sparkling Water
Mango Sparkling Water
Strawberry Yogurt
Mango Yogurt
Blueberry
Pineapple yogurt
Mini Boba
Regular Boba
Crystal Boba
Grass Jelly
Coffee Jelly
Creamy Cake
Cheese foam
Brown Sugar Boba
Lychee Crystal Boba
Dalgona Crunch
Dalgona Cheese Foam
0% / 25% / 50% / 75%/ 100% / 125%


Now saving to a separate file: hana_menu.txt

Thanks for using my program!
Now exiting...
>>>
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.