Created
February 27, 2016 00:47
-
-
Save ledlogic/761a3c1e5e7723a9c08d to your computer and use it in GitHub Desktop.
Extract urls from har file to csv (text) file.
This file contains 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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'json' | |
require 'csv' | |
infile = ARGV[0] | |
json = File.read(infile) | |
parsed = JSON.parse(json.encode("UTF-8")) | |
outfile = ARGV[1] | |
CSV.open(outfile, "wb") do |csv| | |
parsed["log"]["entries"].each do |entry| | |
csv << [entry["request"]["url"]] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment