Skip to content

Instantly share code, notes, and snippets.

@py-ranoid
Created January 14, 2019 06:52
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 py-ranoid/98cfeee828e5c47c61d9da618c771261 to your computer and use it in GitHub Desktop.
Save py-ranoid/98cfeee828e5c47c61d9da618c771261 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