Extract HTML Files from HAR
Web browsing sessions can be saved as HAR files for debugging. "Save as HAR" is supported by Firefox, Chrome, OWASP ZAP and Burp.
This tool extracts HTML web pages from HAR file.
Install # ↑
Har-extract-text.py is free software under GNU General Public License, version 3.
$
$
And enjoy
$
Saving a HAR file # ↑
Web browsers and MITM proxies can save HAR files. HAR files are supported by Firefox, Chrome, Edge, OWASP ZAP and Burp.
Firefox: F12: Network (tab). Right click: "Save all as HAR".
OWASP ZAP: History (pane). Select multiple URLs. Right click: "Save Selected Entries as HAR (HTTP Archive File)"
Usage # ↑
Save your HAR file. Here, I've saved it as "tero.har".
$
Created output directory "har-out/."
Loaded HAR file "tero.har" with 25 entries.
Wrote "har-out/Foo.html": 23 567 chars.
Wrote "har-out/Bar.html": 42 000 chars.
...
Wrote 25 HTML files to "har-out/". Done.
Now you can open the HTML files using a web browser.
Help # ↑
$
usage: har-extract-text.py [-h] [-v] [-d] [-m MATCH] [-i INFILE] [-o OUTDIR] [-f]
Extract text (e.g. HTML pages) from HAR file
First, save a HAR file using OWASP ZAP (tested) or Firefox. Then
har-extract-text.py tero.har
Copyright 2023 Tero Karvinen http://TeroKarvinen.com .
GNU General Public License, version 3.
optional arguments:
-h, --help show this help message and exit
-v, --verbose
-d, --debug
-m MATCH, --match MATCH
Only extracts files matching regex.
-i INFILE, --infile INFILE
-o OUTDIR, --outdir OUTDIR
-f, --overwrite Overwrite HTML files if they already exist.
Copyright 2023 Tero Karvinen http://TeroKarvinen.com
HAR is just JSON # ↑
A HAR file just saves your browsing as a JSON file. Here is a sample from a start of a HAR file saved from Firefox.