Elsa James
Elsa James

Reputation: 101

Chrome Dev Tools: How to copy all URL's from Network Tab at once?

Is there any way to copy all the loaded links from the Network Tab in Chrome Dev Tools?

Below is the image for example and I want to copy all the files links? How can I do that at once.

enter image description here

Upvotes: 6

Views: 6932

Answers (2)

Evandro Coan
Evandro Coan

Reputation: 9475

You can also use a more complex manipulation to print only/filter out some of these entries. For example, this creates an HTML page with all .svg from a har file: cat myexported.har | jq --raw-output '.log.entries | .[] | select(.response.content.mimeType == "image/svg+xml") | "<img src=\"data:image/svg+xml;base64,\(.response.content.text)\">"' > svgs.html

Upvotes: 0

Jim Grisham
Jim Grisham

Reputation: 457

  1. Use the 'Save all as HAR with content' command from the contextual ('right-click') menu in the Network tab of Chrome/Edge/etc. Developer Tools to save it as a .har file. (For the following example, I named that new file requests.json.)

  2. 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 the bash shell):

    a. View the results:

    • 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
  3. Delete the file you saved in step 1 when have no more use for it. (it may contain personal information and API keys; depending on the site, it also may be quite large)

--

(Source: my reply to this gist on GitHub)

Upvotes: 1

Related Questions