Created
August 8, 2013 10:15
-
-
Save markprovan/6183460 to your computer and use it in GitHub Desktop.
Convert Google Chromes Network anaylsis to csv. Right click and copy HAR, then save that file as json. `ruby gc_network_to_csv.rb network.json`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "json" | |
require "csv" | |
filename = ARGV[0] | |
json = JSON.parse(File.read(filename)) | |
CSV.open("#{filename.gsub('.json', '')}.csv", "w") do |csv| | |
csv << ["URL", "File Size"] | |
json["log"]["entries"].each do |r| | |
csv << [r["request"]["url"], r["response"]["content"]["size"]] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment