"""Volume 3B: Web Scraping 1. Spec file.""" from bs4 import BeautifulSoup import re html_doc = """ The Three Stooges

The Three Stooges

Have you ever met the three stooges? Their names are Larry, Mo and Curly; and they are really hilarious.

...

""" # Problem 1 def prob1(filename): """ Find all of the tags used in a particular .html file and the value of the 'type' attribute. Inputs: filename: Name of .html file to parse Outputs: - A set of all of the tags used in the .html file - The value of the 'type' attributes for the style tag """ tags_used = [] # Make sure to return this is a set value = "" return tags_used, value # Problem 2 def prob2(): """Prints (not returns) the prettified string for the Three Stooges HTML. """ print "" # Problem 3 def prob3(): """Returns [u'title'] from the Three Stooges soup""" return None # Problem 4 def prob4(): """Returns u'Mo' from the Three Stooges soup""" return None # Problem 5 def prob5(method): """Returns the u'More information...' using two different methods. If method is 1, it uses first method. If method is 2, it uses the second method. """ if method == 1: return None if method == 2: return None # Problem 6 def prob6(method): """Returns the tag associated with the "More information..." link using two different methods. If method is 1, it uses the first method. If method is 2, it uses the second method. """ if method == 1: return None if method == 2: return None # Problem 7 def prob7(): """Loads 'SanDiegoWeather.htm' into BeautifulSoup and prints (not returns) the tags referred to the in the Problem 7 questions. """ # Question 1 print "" # Question 2 print "" print "" # Question 3 print "" # Problem 8 def prob8(): """Loads 'Big Data dates.htm' into BeautifulSoup and uses find_all() and re to return a list of all tags containing links to bank data from September 30, 2003 to December 31, 2014. """ return None