Skip to content

Instantly share code, notes, and snippets.

@jjuel
Created May 4, 2017 02:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjuel/9aec8354ec7dbaebb87370bb6ba3c140 to your computer and use it in GitHub Desktop.
Save jjuel/9aec8354ec7dbaebb87370bb6ba3c140 to your computer and use it in GitHub Desktop.
def get_scores(url):
'''Get scores with BS from given URL'''
scores = []
source_code = requests.get(url)
plain_text = source_code.text
soup = BeautifulSoup(plain_text, 'lxml')
for text in soup.find_all('pre'):
if text.text is None:
continue
content = text.text
scores.append(content)
return scores
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment