Chrome DevTools Extract all URLs JS Snippet

A forum packed with Technical SEO golden nuggets. Guides, tip, tutorials, PHP snippets and JS scripts straight from Sitebee. We are sharing the technical SEO knowledge and skills that we have learnt over the years.


Freelance Technical SEO
Staff member
Here is a handy JS snippet to extract all URLs within a webpage using the Console within Chrome DevTools.

var urls = document.getElementsByTagName('a');
for (url in urls) {
    console.log ( urls[url].href );
The output will resemble the below:

I find this method useful for data extraction. Pulling menu links, hreflang alt URLs, etc. Save it as a bookmarklet to save time pasting in the snippet over and over.