Merge pull request #7 from nsna/har-parse-fix

Update har_capture_reader.py
pull/8/head
alufers 2 years ago committed by GitHub
commit 90130fb524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -71,9 +71,9 @@ class HarCaptureReader:
self.progress_callback = progress_callback
def captured_requests(self) -> Iterator[HarFlowWrapper]:
har_file_size = os.path.getsize(self.file_path)
with open(self.file_path, 'r') as f:
with open(self.file_path, 'r', encoding='utf-8') as f:
data = json_stream.load(f)
for entry in data['log']['entries'].persistent():
for entry in data['log']['entries'].persistent():
if self.progress_callback:
self.progress_callback(f.tell() / har_file_size)
yield HarFlowWrapper(entry)

Loading…
Cancel
Save