Created
December 6, 2020 21:53
-
-
Save timo-berg/7aa2297911147e53bd0c4e6804a9ecd7 to your computer and use it in GitHub Desktop.
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
import json | |
import requests | |
from haralyzer import HarParser, HarPage | |
with open('pictures.har', 'r') as f: | |
har_page = HarPage('page_1', har_data=json.loads(f.read())) | |
for i, entry in enumerate(har_page.entries): | |
request = entry['request'] | |
url = request['url'] | |
response = requests.get(url) | |
pic_string = "pciture_{}.png".format(i) | |
file = open(pic_string, "wb") | |
file.write(response.content) | |
file.close() | |
print("Picture Nr {} saved!".format(i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment