diff --git a/scrape.py b/scrape.py index 2fa06c2..32a5ef3 100755 --- a/scrape.py +++ b/scrape.py @@ -267,7 +267,7 @@ def Get_Follows(url, limit = 100): user_dict = {} track_dict = {} -with shelve.open('shelf.db', 'r') as shelf: +with shelve.open('shelf.db') as shelf: if 'user_dict' in shelf.keys(): user_dict = shelf['user_dict'] if 'track_dict' in shelf.keys(): @@ -327,7 +327,7 @@ for i in range(MAX_DEGREE + 1): user_dict[user.url_username] = user # Update the shelf with the new dictionaries - with shelve.open('shelf.db', 'c') as shelf: + with shelve.open('shelf.db') as shelf: shelf['user_dict'] = user_dict shelf['track_dict'] = track_dict