How to copy all links from a webpage
18 October 2026 · 4 min read
Quick answer
Chrome has no menu item that copies every link on a page. You can run one line in the DevTools console to collect them, or add a small tool to the page with a button that copies every link, one per line, with duplicates removed.
Why you'd need every link
Collecting links is a surprisingly common job. You might want every article in a reading list, every file in a download index, every product in a category, or every page in a site's navigation to check them for broken links. Copying them one at a time with right-click and Copy link address is fine for five links and miserable for two hundred.
The built-in way
Chrome doesn't have a "copy all links" command. It can save the whole page with Save page as, and the saved HTML contains every link, but you'd still have to dig them out of the file.
The manual way
Chrome's developer tools can collect the links for you, and you don't need to know how to program to use this:
- On the page, press F12 (or Cmd+Option+J on a Mac) and open the Console tab.
- Paste the line below and press Enter.
copy([...new Set([...document.querySelectorAll("a[href]")].map((a) => a.href))].join("\n"))
- Every link on the page is now on your clipboard, one per line. Paste it into a text file or a spreadsheet.
What the line does, in words: it finds every link element on the page, takes the full address of each one, removes duplicates, joins them with line breaks, and copies the result. The copy function only exists in the DevTools console, so this doesn't work from anywhere else.
Two things to know. Chrome may ask you to type a confirmation phrase the first time you paste into the console, as a guard against people being tricked into running harmful code. That's a good habit: only paste code you understand, like the line above. And the line only sees links that are on the page at that moment. On a page that loads more as you scroll, scroll to the bottom first.
Make it permanent with a tool
If you collect links from the same site regularly, a button on the page is easier than opening the console each time. A userscript is a short piece of JavaScript that runs on a website you choose. One that adds a Copy links button does what the console line does, on click, and can be smarter about it: it can skip links to the site's own menus and footer, keep only links in the main list, or filter by type, such as only PDF files.
ScriptPanda is a Chrome extension that builds tools like this from a plain description. Open its side panel on the page, paste the request at the end of this guide, and it writes the tool and installs it there. It can see the structure of the page, so you can describe which links you mean in ordinary words, for example "only the links in the search results" or "only links to product pages".
Copying links doesn't call AI, so using the button doesn't use your plan's requests. Building the tool and changing it do.
Ideas for follow-ups:
- Copy each link with its text, as a Markdown list.
- Show a count of the links before copying.
- Download the links as a text file instead of copying them.
When you need more than links
If you want each item's title, link and price as columns in a spreadsheet, a CSV export is a better fit. The related guide adds an Export CSV button to any list.
Limits
The button copies links that are on the page when you click it. It can't follow links to other pages and collect theirs, and it doesn't run on a schedule. Links that only appear after you scroll, or behind a "Load more" button, are included only once they've loaded. Some sites build links with scripts rather than ordinary link elements, and those can be missed, so tell ScriptPanda what's missing and ask it to fix the tool. If the site changes its layout, the same applies.
Do it with ScriptPanda
Build it in one request
Add a button to this page that copies every link on it to my clipboard, one URL per line, with duplicates removed.
- 1Add ScriptPanda to Chrome.
- 2Open the side panel on the site you want to change.
- 3Paste the request and send it. ScriptPanda builds the tool into the page.