9

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.

Community
  • 1
  • 1
Hafiz Muhammad Shafiq
  • 6,781
  • 10
  • 49
  • 92
  • possible duplicate of [Export all http requests on a specific page to txt/csv](http://stackoverflow.com/questions/19246599/export-all-http-requests-on-a-specific-page-to-txt-csv) – ryuichiro Jul 27 '15 at 08:25

5 Answers5

8

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.

servuskevin
  • 81
  • 1
  • 3
  • 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. – Sal Alturaigi Feb 02 '21 at 12:57
  • You can open an issue here and upload your .har file in the issue so that the author can take a look. https://github.com/hintdesk/networkhartocsv – servuskevin Feb 03 '21 at 11:56
6

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.

arvymetal
  • 1,799
  • 20
  • 31
  • 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.csv` – Phil C Nov 23 '20 at 11:04
2

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

Hafiz Muhammad Shafiq
  • 6,781
  • 10
  • 49
  • 92
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).
thdoan
  • 15,024
  • 1
  • 46
  • 40
0

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

tltjr
  • 918
  • 1
  • 12
  • 14