Created
October 30, 2014 00:24
-
-
Save rcackerman/7e5670a43f7fdd052d2e to your computer and use it in GitHub Desktop.
Why isn't this working?? :-(
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
| def get_dict_keys(url): | |
| keys = [] | |
| op = s.urlopen(url) | |
| bs = BeautifulSoup(op) | |
| keys_th = bs.find('table', class_ = 'intv').find('tr').find_all('th') | |
| [keys.append(key.string) for key in keys_th] | |
| print keys | |
| keys |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Because there's no return - duh.
def get_dict_keys(url):
keys = []
op = s.urlopen(url)
bs = BeautifulSoup(op)
keys_th = bs.find('table', class_ = 'intv').find('tr').find_all('th')
[keys.append(key.string) for key in keys_th]
print keys
return keys