Skip to content

Instantly share code, notes, and snippets.

@cvan
Last active June 27, 2026 09:03
Show Gist options
  • Select an option

  • Save cvan/03ffa0c71317cb6b0b95a41ab189b097 to your computer and use it in GitHub Desktop.

Select an option

Save cvan/03ffa0c71317cb6b0b95a41ab189b097 to your computer and use it in GitHub Desktop.
get all URLs of all network requests made on a web page from the Chrome Dev Tools (from an exported HAR)

Setup

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)'

Usage

  1. Open the Chrome Developer Tools (Command+Option+i)
  2. Click the Network tab
  3. Reload the page (Command+r)
  4. In the Network tab, hover over any area in the table that is not a link (e.g., the Status column)
  5. Right click (Control+click) to open the context menu and click Copy All as HAR
  6. Open your favourite command-line interface (e.g., Terminal)
  7. Enter hurlp to print the URLs or hurld to download the files
@ixqbar

ixqbar commented Sep 3, 2024

Copy link
Copy Markdown

what's harurls ?

@juhlie

juhlie commented Dec 2, 2025

Copy link
Copy Markdown

what's harurls ?

looks like it existed in previous revisions:

alias harurls='pbpaste | jq ".log.entries" | jq --raw-output "[.[] | .request.url] | sort | unique | .[]"'

@Sargates

Copy link
Copy Markdown

For posterity, the "Save all as HAR with content" option in the context menu has been removed as per https://issues.chromium.org/issues/361717594
The new way to do it is to press the download button which will export all requests made as a sanitized HAR file.
The button looks like a download icon and is located at the right-most end of the row containing the "Clear log" button and the "Preserve Log" ticker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment