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.
15 Answers
You can download the HAR file from Google or Firefox browser and use this online tool to convert the HAR file to CSV.
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.
2I 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.
1Here is a small application that can be used to convert .HAR file to csv. Further you can import csv to excel.
2Google now has an npm package that handles this nicely.
Here's a quick and dirty way to get the data into Excel:
- Test the site at WebPageTest.
- After you get the results, go to the Details tab.
- Copy the Request Details table and paste it into Excel (Excel should automatically split up the table into columns).