(file_path)
load HAR file and return log entries list

    Args:
        file_path (str)

    Returns:
        list: entries
            [
                {
                    "request": {},
                    "response": {}
                },
                {
                    "request": {},
                    "response": {}
                }
            ]
load HAR file and return log entries list
load HAR file and return log entries list
def load_har_log_entries(file_path):
    """ load HAR file and return log entries list

    Args:
        file_path (str)

    Returns:
        list: entries
            [
                {
                    "request": {},
                    "response": {}
                },
                {
                    "request": {},
                    "response": {}
                }
            ]

    """
    with open(file_path, mode="rb") as f:
        try:
            content_json = json.load(f)
            return content_json["log"]["entries"]
        except (TypeError, JSONDecodeError) as ex:
            logger.error(f"failed to load HAR file {file_path}: {ex}")
            sys.exit(1)
        except KeyError:
            logger.error(f"log entries not found in HAR file: {content_json}")
            sys.exit(1)
def load_har_log_entries ( file_path ) : with open ( file_path , mode = "rb" ) as f : try : content_json = json . load ( f ) return content_json [ "log" ] [ "entries" ] except ( TypeError , JSONDecodeError ) as ex : logger . error ( f"failed to load HAR file {file_path}: {ex}" ) sys . exit ( 1 ) except KeyError : logger . error ( f"log entries not found in HAR file: {content_json}" ) sys . exit ( 1 )