Created
May 4, 2017 02:12
-
-
Save jjuel/9aec8354ec7dbaebb87370bb6ba3c140 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
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