From 3dcb8d00281631140017e1bea984a32e8b36fb58 Mon Sep 17 00:00:00 2001 From: Anshu Kumari Mahato Date: Sun, 4 Oct 2020 20:28:21 +0530 Subject: [PATCH] Updated C4.1. Programming assignment.py updated the errors to make it more compatible for python 3 --- .../C4.1. Programming assignment.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Unit 4 - Programs that surf the web/C4.1. Programming assignment.py b/Unit 4 - Programs that surf the web/C4.1. Programming assignment.py index ad702a3..5b67f23 100644 --- a/Unit 4 - Programs that surf the web/C4.1. Programming assignment.py +++ b/Unit 4 - Programs that surf the web/C4.1. Programming assignment.py @@ -32,13 +32,14 @@ import urllib -from BeautifulSoup import * +from urllib.request import urlopen +from bs4 import BeautifulSoup sample_url = "http://python-data.dr-chuck.net/comments_42.html" data_url = "http://python-data.dr-chuck.net/comments_277464.html" #Getting the html information and parsing it with BeautifulSoup -html = urllib.urlopen(data_url).read() +html = urlopen(data_url).read() soup = BeautifulSoup(html) #Getting a list with the "span" tags