Skip to content

Commit

Permalink
correct patch (rushilsrivastava#5) for python 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
loopyd committed Mar 11, 2018
1 parent 9a6458b commit 44d6e19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions google_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def search(url):
with open('dataset/logs/google/source.html', 'w+', encoding='utf-8', errors='replace') as f:
f.write(source)
else:
with io.open('dataset/logs/google/source.html', 'w+', encoding='utf-8', errors='replace') as f:
with io.open('dataset/logs/google/source.html', 'w') as f:
f.write(source)

browser.close()
Expand Down Expand Up @@ -137,7 +137,7 @@ def download_image(link, image_data):
with open("dataset/google/{}/".format(query) + "Scrapper_{}.json".format(str(download_image.delta)), "w", encoding='utf-8', errors='replace') as outfile:
json.dump(image_data, outfile, indent=4)
else:
with open("dataset/google/{}/".format(query) + "Scrapper_{}.json".format(str(download_image.delta)), "w", encoding='utf-8', errors='replace') as outfile:
with io.open("dataset/google/{}/".format(query) + "Scrapper_{}.json".format(str(download_image.delta)), "w") as outfile:
json.dump(image_data, outfile, indent=4)

# rename the files if the 'hash' property has been set
Expand Down

0 comments on commit 44d6e19

Please sign in to comment.