diff --git a/Week-4/Scraping HTML Data with BeautifulSoup.py b/Week-4/Scraping HTML Data with BeautifulSoup.py index f9670a3..1e61247 100644 --- a/Week-4/Scraping HTML Data with BeautifulSoup.py +++ b/Week-4/Scraping HTML Data with BeautifulSoup.py @@ -16,12 +16,14 @@ will read the data directly from the URL. Note: Each student will have a distinct data url for the assignment - so only use your own data url for analysis. ''' + import urllib +from urllib.request import urlopen from bs4 import BeautifulSoup url = raw_input('Enter - ') -html = urllib.urlopen(url).read() +html = urlopen(url).read() soup = BeautifulSoup(html) tag = soup("span") count=0 @@ -30,5 +32,5 @@ x=int(i.text) count+=1 sum = sum + x -print count -print sum +print (count) +print (sum)