Commit 1ea4b613 authored by Barkin Simsek's avatar Barkin Simsek 🐢
Browse files

Let BaseFetcher produce valid HAR exports in JSON format

parent 072ef6a1
Pipeline #7335 passed with stages
in 2 minutes and 30 seconds
import os
import json
import time
import shutil
import logging
......@@ -225,12 +226,13 @@ class BaseFetcher:
self.page_source = self.driver.page_source
self.page_cookies = self.driver.get_cookies()
self.page_title = self.driver.title
self.page_har = self.driver.execute_async_script(
har_dict = self.driver.execute_async_script(
"""
var callback = arguments[arguments.length - 1];
HAR.triggerExport().then((harLog) => { callback(harLog) });
"""
)
self.page_har = json.dumps({"log": har_dict})
def get_selenium_logs(self) -> dict:
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment