Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Week-4/Scraping HTML Data with BeautifulSoup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -30,5 +32,5 @@
x=int(i.text)
count+=1
sum = sum + x
print count
print sum
print (count)
print (sum)