How to import HAR file to excel
Asked Answered
S

5

13

I have to know some informations about documents loaded by a browser (e.g. chrome ) for that inspect element is good choise. Now I have to import data to an excel. Inspect element allow to save data as .har ( http archive) file.

How I can save network informations from inspect element to excel. My browser is Google chrome. I have found an answer here that gives information but no information about excel.

Shinleaf answered 27/7, 2015 at 8:16 Comment(1)
possible duplicate of Export all http requests on a specific page to txt/csvHelicopter
S
2

Here is a small application that can be used to convert .HAR file to csv. Further you can import csv to excel.

Shinleaf answered 27/7, 2015 at 10:7 Comment(2)
Thanks for quick responseShinleaf
I'm getting a 504 error when trying to access that page.Sunlight
P
12

I also needed to turn the .har file into .csv so that I could sum up some values.

When looking for a solution that would work under MacOs (so possibly by not installing a dedicated app), I found this Akamai blog post solution that just implied to install jq. I didn't get the expected output, so I adapted the proposed script this way:

cat my_chrome_export.har | jq '[ "URL", "Time", "Wait time", "Status", "Body size","Content-Type", "Content-Encoding"],
    (.log.entries[] | [
        .request.url,
        .time,
        .timings.wait,
        .response.status,
        .response.content.size,
        .response.content.mimeType,
        .response.content.encoding
]) | @csv' | sed 's/\\"//g' | sed 's/"//g' > result.csv

The output is a CSV file with the following columns: URL, Time, Wait time, Status, Body size, Content-Type, Content-Encoding.

Purree answered 4/3, 2020 at 21:46 Comment(1)
This seems to be the best solution for non-standard HARs. Works for me on Windows with: .\jq-win64 '.log.entries | .[] | [...] | @csv' input.har | %{$_ -replace '(^")|("$)',''} | %{$_ -replace '\\"','"'} > out.csvEigenvalue
S
12

You can download the HAR file from Google or Firefox browser and use this online tool to convert the HAR file to CSV.

Link to online tool: https://hintdesk.github.io/networkhartocsv/input

Just select the exported HAR file and let the tool parse it. Then select the column you want to export and export the current rows to CSV.

You can also filter out the rows which are not relevant.

Somite answered 10/5, 2020 at 18:56 Comment(2)
Does this website still work? I've tried running it multiple times on different browsers, but nothing happens whether I upload my .har file or paste it inline.In
You can open an issue here and upload your .har file in the issue so that the author can take a look. github.com/hintdesk/networkhartocsvSomite
H
5

Google now has an npm package that handles this nicely. https://github.com/google/har2csv

Homeopathic answered 7/4, 2021 at 16:16 Comment(0)
S
2

Here is a small application that can be used to convert .HAR file to csv. Further you can import csv to excel.

Shinleaf answered 27/7, 2015 at 10:7 Comment(2)
Thanks for quick responseShinleaf
I'm getting a 504 error when trying to access that page.Sunlight
C
1

Here's a quick and dirty way to get the data into Excel:

  1. Test the site at WebPageTest.
  2. After you get the results, go to the Details tab.
  3. Copy the Request Details table and paste it into Excel (Excel should automatically split up the table into columns).
Casimiracasimire answered 24/8, 2016 at 10:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.