Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Scraping HTML Data with BeautifulSoup.py #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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)