Skip to content

Instantly share code, notes, and snippets.

@py-ranoid
Created January 14, 2019 06:52
Show Gist options
  • Save py-ranoid/53fc89e6762050cc37f3b7f7333b88a4 to your computer and use it in GitHub Desktop.
Save py-ranoid/53fc89e6762050cc37f3b7f7333b88a4 to your computer and use it in GitHub Desktop.
Downloading Google CodeIn tasks without an API Key.
all_rows = []
for fname in glob("/Users/vishalgupta/Downloads/Task instances _ Google Code-in *.htm"):
with open(fname) as f:
cont = f.read()
s = soup(cont)
rows = s.select('md-table-container tbody tr')
for row in rows:
vals = [i.text.strip() for i in row.select('td') if i.text.strip()]
all_rows.append(vals)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment