How to Extract All Links From a Page (Without Missing Any)
Links are easy to miss. A page can hide them in navigation menus, footers, buttons, images, and long paragraphs. If you copy only the links you can see, you may leave out the ones that matter most. This guide shows a careful, repeatable way to extract all links from a page without missing any, using the page source and a simple checking routine. You do not need special software to follow it, and you do not need to guess. You will work from what the page actually contains, then check your result before you use it.
A link on a web page is usually an anchor element. In the page source it looks like a piece of markup that points to another address. The visible words may say “Read the guide,” while the address itself points somewhere else. That difference is why copying visible text is not enough. To extract links well, you need both parts: the address the link points to, and the words a reader sees. When you collect both, your list is useful for checking a page, auditing navigation, fixing broken links, or building a simple inventory of where a page sends people.
What Counts as a Link
Before you start, decide what you want to count. A complete list usually includes links in the main content, links in the header and footer, links on buttons, and links wrapped around images. It may also include links that open in a new tab. It should not silently include every address mentioned in plain text unless that address is actually clickable. A web address typed in a paragraph without a link is not the same as a link, even though a reader could copy it. Keeping that distinction clear makes your result easier to check.
Some pages also contain links that are added by scripts after the page loads. Those links may not appear in the first copy of the page source. If you need those too, you should check the rendered page as well as the source, and note which method you used. For most ordinary articles, documentation pages, and landing pages, the page source plus a careful visual pass will capture the links you need. If a page is highly interactive, say so in your notes rather than claiming your list is complete when it is not.
How to Extract All Links From a Page
Follow these steps in order. The order matters because each step catches a different kind of miss.
Step 1: Copy the Page Source
Open the page in your browser. Use the browser menu to view the page source, or use the keyboard shortcut your browser provides. Save that source in a text file or paste it into a text editor. Working from a saved copy is better than working from memory because you can search it, count items, and compare it later. Do not edit the source while you extract links. Keep the original copy unchanged so you can return to it if your list looks wrong.
Step 2: Find Every Anchor Element
Search the source for anchor elements. In HTML, these begin with an anchor tag and include an href attribute that holds the destination address. Go through the matches one at a time rather than jumping to the ones that look important. Navigation links, footer links, and small utility links are easy to skip when you scan quickly. If your editor can highlight all matches, use that view to get a sense of how many links there are before you start copying them out.
Step 3: Record the Address and the Link Text
For each link, record two things: the full destination address, and the visible text or a short description of what the link contains. If the link wraps an image, write a description such as “logo image in header” or “diagram in section two.” If the link has no visible text, note that fact. A list of bare addresses is hard to review, and a list of link text alone does not tell you where each link goes. Together, the two columns let you or someone else check the work.
Step 4: Check the Parts of the Page You Cannot See in the Source
Return to the rendered page and scroll through it slowly, from top to bottom. Look at the header, the sidebar, the footer, any banners, and any collapsed sections. Expand accordions, tabs, and menus if the page has them, and note any links that appear. Compare what you see with your list. If a visible link is missing from your list, add it and note that it came from the rendered page rather than the source. If a link in your list is not visible, keep it but mark it as hidden or in a menu, so the next reader understands why it is there.
Step 5: Check for Duplicates
Many pages link to the same destination more than once. A home page may link to a contact page from the header, the footer, and a button in the main content. Those are three links, not one, even though they share one destination. Decide before you deduplicate whether you want a list of every link occurrence or a list of unique destinations. For an audit, occurrences matter because each one is a place a reader can click. For a simple inventory of destinations, unique addresses matter more. Record your choice at the top of your list, and if you remove duplicates, keep a count of how many times each destination appeared.
Step 6: Verify Each Link
Open each destination or check it with a link checker. A link that points to the wrong page, a page that has moved, or a page that returns an error is not useful even if you extracted it correctly. Check that the destination matches the link text. A link that says “Pricing” should not land on a blog post. Note any links that redirect, and note the final destination if it differs from the address in the source. Verification is slower than extraction, but it is what turns a raw list into a trustworthy one.
Worked Example
Imagine a short sample page with a header, one article, and a footer. The header has a logo that links to the home page and a navigation link labelled “Guides.” The article has two links in its text: one labelled “the full checklist” and one labelled “contact the team.” The footer repeats the Guides link and adds a link labelled “Privacy.” If you only copy the links in the article, you will find two links. If you follow the steps above, you will find six link occurrences: logo to home, Guides in the header, the checklist link, the contact link, Guides in the footer, and Privacy in the footer. There are five unique destinations, because Guides appears twice.
To record this example, make a simple table with three columns: link text, destination, and location on the page. Write one row per occurrence. For the logo, the location is “header, logo image.” For the repeated Guides link, write two rows, one for the header and one for the footer. Then add a short note: “Six occurrences, five unique destinations. Guides appears twice.” That note prevents a later reader from thinking you made a counting mistake. It also makes it easy to see which links are repeated on purpose and which might be accidental duplication.
Next, check the duplicates. In this example, the repeated Guides link is intentional, because headers and footers often repeat the same navigation. You would keep both rows if you are auditing occurrences. If you only need unique destinations, you would keep one Guides row and note that it appears twice. Finally, verify each destination by opening it. If the Privacy link lands on the correct privacy page and the checklist link lands on the checklist, the list is ready to use. If any link lands somewhere unexpected, fix the page or correct your record, and keep a note of what you changed.
Limitations
This method has limits. It will not reliably capture links that are created only after a reader clicks a button, fills in a form, or scrolls through a long interactive widget, unless you also inspect the rendered page in those states. It will not tell you whether a link is a good link, only whether it exists and where it goes. It will not check links inside files such as PDFs unless you open those files separately. It also will not fix a page for you. Extraction is a way to see what is there, not a way to judge whether the page structure is sensible.
There are also permission and privacy limits. Do not scrape sites that forbid it. Check the site terms, the robots file, and any notice that restricts automated copying before you extract links at scale. Do not use extracted links to harvest email addresses, to spam people, or to copy someone else content. If a page is behind a login or contains private material, do not share the extracted list outside the access you already have. Respecting those boundaries is part of doing the work carefully.
Frequently Asked Questions
Do I need to copy the page source, or can I just copy visible links?
Copy the page source when you want a complete list. Visible copying misses links in menus, footers, images, and collapsed sections. The source gives you a searchable record you can check, and a visual pass catches links the source alone might miss.
How do I handle duplicate links?
Decide whether you need occurrences or unique destinations. Keep one row per occurrence for an audit, and keep a count of repeats. If you need unique destinations, deduplicate carefully and keep a note of how many times each destination appeared.
What if a link has no text?
Describe what the link contains, such as an image or an icon, and note its location. A link without text is still a link, and it may need an accessible label on the page itself. Recording it helps the page owner fix it.
Should I verify every link?
Yes, when the list will be used to fix a page or to guide readers. Verification catches moved pages, redirects, and mismatched link text. If you cannot verify every link, say which links you checked and which you did not.
A careful extraction is not about speed. It is about working from the source, checking the rendered page, recording both the address and the text, handling duplicates openly, and verifying the result. Do that, and your list will be something you and others can trust.
Try a Tool
Free, in your browser — no sign-up.
Related Articles
How to Check an Image’s Dimensions Before You Upload It
Check an image's width, height, and file size before uploading, avoid upscaling, and test it on your site.
Read article →How to Take a Scrolling Screenshot of a Long Page
Learn how to take a clean scrolling screenshot of a long page, check the output, and avoid sharing private data.
Read article →How to Check a File Size Before You Download It
Check a file size before you download it. Learn MB vs KB, where size is shown, how to check storage, and when…
Read article →