# Visual Analytics 2014-2015 - Assignment #1 # Name: INSERT YOUR NAME HERE # Import the standard library for loading web pages import os import urllib.request as urllib2 from bs4 import BeautifulSoup import csv # Assignment 1.1 - Write a function to fetch and save all # of the loyalty card pages found here: # 'http://aviz.saclay.inria.fr/~isenberg/VA/loyalty/' loyalty_root = 'http://aviz.saclay.inria.fr/~isenberg/VA/loyalty/' loyalty_first = 'http://aviz.saclay.inria.fr/~isenberg/VA/loyalty/lc_output_0.html' def fetch_loyalty_pages(): # TODO: Fetch loyalty pages print('TODO: Fetch loyalty pages and save them locally') # Assignment 1.2 - Write a function that processes all # of the saved loyalty card files and produces a CSV def process_loyalty_pages(): #TODO: Process loyalty pages print('TODO: Process loyalty pages to a CSV') # Assignment 1.3 - Write a function to fetch and save all # of the credit card pages found here: # 'http://aviz.saclay.inria.fr/~isenberg/VA/credit/' credit_root = 'http://aviz.saclay.inria.fr/~isenberg/VA/credit/' credit_first = 'http://aviz.saclay.inria.fr/~isenberg/VA/credit/cc_first_output_Q0YPUSKB.html' def fetch_credit_pages(): # TODO: Fetch credit pages print('TODO: Fetch credit pages and save them locally') # Assignment 1.4 - Write a function that processes all # of the saved credit card files and produces a CSV def process_credit_pages(): #TODO: Process credit pages print('TODO: Process credit pages to a CSV') # If run from the command line, the script should fetch # and then process both datasets. if __name__ == "__main__": fetch_loyalty_pages() process_loyalty_pages() fetch_credit_pages() process_credit_pages()