Created
January 14, 2019 06:52
-
-
Save py-ranoid/98cfeee828e5c47c61d9da618c771261 to your computer and use it in GitHub Desktop.
Downloading Google CodeIn tasks without an API Key.
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
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