From 6b17494bfc75ed2bf45392f3fec1c8abfaff3bad Mon Sep 17 00:00:00 2001 From: serv-inc Date: Fri, 5 May 2017 12:59:53 +0200 Subject: [PATCH] gave warning without "lxml". this has already been changed on udacity.com --- Lesson_2_Problem_Set/01-Carrier_List/carriers.py | 4 ++-- Lesson_2_Problem_Set/02-Airport_List/airports.py | 4 ++-- Lesson_2_Problem_Set/03-Processing_All/process.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Lesson_2_Problem_Set/01-Carrier_List/carriers.py b/Lesson_2_Problem_Set/01-Carrier_List/carriers.py index 617662d..d599bb5 100644 --- a/Lesson_2_Problem_Set/01-Carrier_List/carriers.py +++ b/Lesson_2_Problem_Set/01-Carrier_List/carriers.py @@ -18,7 +18,7 @@ def extract_carriers(page): with open(page, "r") as html: # do something here to find the necessary values - soup = BeautifulSoup(html) + soup = BeautifulSoup(html, "lxml") return data @@ -48,4 +48,4 @@ def test(): assert "FL" in data assert "NK" in data -test() \ No newline at end of file +test() diff --git a/Lesson_2_Problem_Set/02-Airport_List/airports.py b/Lesson_2_Problem_Set/02-Airport_List/airports.py index 7bad844..ed9e395 100644 --- a/Lesson_2_Problem_Set/02-Airport_List/airports.py +++ b/Lesson_2_Problem_Set/02-Airport_List/airports.py @@ -11,7 +11,7 @@ def extract_airports(page): data = [] with open(page, "r") as html: # do something here to find the necessary values - soup = BeautifulSoup(html) + soup = BeautifulSoup(html, "lxml") return data @@ -22,4 +22,4 @@ def test(): assert "ATL" in data assert "ABR" in data -test() \ No newline at end of file +test() diff --git a/Lesson_2_Problem_Set/03-Processing_All/process.py b/Lesson_2_Problem_Set/03-Processing_All/process.py index 5bb1b5f..591cec8 100644 --- a/Lesson_2_Problem_Set/03-Processing_All/process.py +++ b/Lesson_2_Problem_Set/03-Processing_All/process.py @@ -45,7 +45,7 @@ def process_file(f): with open("{}/{}".format(datadir, f), "r") as html: - soup = BeautifulSoup(html) + soup = BeautifulSoup(html, "lxml") return data @@ -66,4 +66,4 @@ def test(): print "... success!" if __name__ == "__main__": - test() \ No newline at end of file + test()