Skip to content

Instantly share code, notes, and snippets.

@salayhin
Created November 2, 2015 13:16
Show Gist options
  • Save salayhin/aaf5d61aa3e4bc7b7436 to your computer and use it in GitHub Desktop.
Save salayhin/aaf5d61aa3e4bc7b7436 to your computer and use it in GitHub Desktop.
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