Skip to content

Instantly share code, notes, and snippets.

@20esaua
Created April 25, 2018 19:15
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 20esaua/f7f4d76cd475bc4a7d04f9370a1ea4c6 to your computer and use it in GitHub Desktop.
Save 20esaua/f7f4d76cd475bc4a7d04f9370a1ea4c6 to your computer and use it in GitHub Desktop.
scrape brainscrape thing.png
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
@BaliKiller
Copy link

This is very helpful for us intellectuals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment