Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from bs4 import BeautifulSoup
- src = ""
- with open("results.htm", 'r') as f:
- src = f.read()
- f.close()
- soup = BeautifulSoup(src, 'html.parser')
- front = soup.find("div", {"class":"front"})
- total_score = 0
- for f in front:
- i = f.find('div', {'class': 'itemTitle'})
- if i:
- i = i.get('id').split("_")
- score = f.find("input", {"id" : str(i[1]) + "_score"})
- if score: total_score += int(score.get('value'))
- print total_score
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement