Using Homebrew on Mac OS X:
brew install jq
Add these aliases to your profile (e.g., ~/.zshrc
, ~/.bashrc
, ~/.profile
, etc.):
alias hurlp='pbpaste | jq ".log.entries" | tee >(jq --raw-output "[.[] | .request.url] | sort | unique | .[]")'
alias hurld='pbpaste | jq ".log.entries" | jq --raw-output "[.[] | .request.url] | sort | unique | .[]" | harurls | tee >(xargs -n 1 curl -O $1)'
- Open the Chrome Developer Tools (
Command
+Option
+i
) - Click the Network tab
- Reload the page (
Command
+r
) - In the Network tab, hover over any area in the table that is not a link (e.g., the Status column)
- Right click (
Control
+click) to open the context menu and click Copy All as HAR - Open your favourite command-line interface (e.g., Terminal)
- Enter
hurlp
to print the URLs orhurld
to download the files
@Sifasol - you probably need to append something like
| pbcopy
to the end ofhurlp
to place the results back on the clipboard; the commands above just display the results (forhurlp
) or download their contents as individual files (forhurld
).For a more universal solution (that works on Linux, et. al.), try:
Use the Network tab of Chrome/Edge/etc. Developer Tools as described above, except use the 'Save all as HAR with content' option to save it as a
.har
file.Run one of the following from the directory where you saved that file, replacing
requests.json
with the filename you used when saving that.har
file (note: these were tested in thebash
shell):a. View the results (same results as '
hurlp
' above):cat requests.json | jq ".log.entries" | jq --raw-output "[.[] | .request.url] | sort | unique | .[]" | less
b. Save the results to a text file:
cat requests.json | jq ".log.entries" | jq --raw-output "[.[] | .request.url] | sort | unique | .[]" >> sorted-urls-from-requests_$(date +%Y-%m-%d_%H:%M).txt