Created
November 2, 2015 13:16
-
-
Save salayhin/aaf5d61aa3e4bc7b7436 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
from BeautifulSoup import * | |
url = raw_input('Enter - ') | |
html = urllib.urlopen(url).read() | |
soup = BeautifulSoup(html) | |
# Retrieve all of the anchor tags | |
tags = soup('span') | |
sum = 0 | |
for tag in tags: | |
number = tag.contents[0] | |
sum = sum + int(number) | |
print sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment