Created
April 25, 2018 19:15
-
-
Save 20esaua/f7f4d76cd475bc4a7d04f9370a1ea4c6 to your computer and use it in GitHub Desktop.
scrape brainscrape thing.png
This file contains hidden or 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
url = 'https://www.brainscape.com/flashcards/domain-4-software-troubleshooting-session-6098579/packs/9226858' | |
def getHTML(page): | |
import urllib.request | |
with urllib.request.urlopen(page) as response: | |
return response.read().decode('utf-8') | |
html = getHTML(url).split("<h3 class='card-answer-text' itemprop='text'>") | |
first = True | |
for thing in html: | |
if not first: | |
print(thing.split('</h3>')[0].replace('<br />', '\n')) | |
first = False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is very helpful for us intellectuals.