Skip to content
Home » Blog » How to Extract All URLs From a Website Into a List

How to Extract All URLs From a Website Into a List

You’re staring at a website with hundreds of pages and you need every single URL — for a site audit, a redirect map, a competitor analysis, maybe just your own sanity check. Copy-pasting them one by one is out of the question. The good news? There are several fast ways to pull every URL into a clean list, and most of them are free.

What You’ll Need

Before You Start

  • The domain name of the site you want to crawl
  • For Method 2: Screaming Frog SEO Spider (free up to 500 URLs)
  • For Method 3: Terminal/Command Prompt with wget installed
  • For Method 4: Python 3 and the requests + BeautifulSoup libraries
  • For Method 5: Verified access to Google Search Console for the site

The right method depends on whether you own the site or not, how large it is, and how comfortable you are with the command line. I’ll walk through all five so you can pick the one that fits your situation.

METHOD 1
Grab URLs From the XML Sitemap

This is the fastest option — if the site has a sitemap. It requires zero tools and works in about 60 seconds. I always try this first.

Step 1. Navigate to https://example.com/sitemap.xml in your browser. Many sites also use /sitemap_index.xml as the main entry point.

Step 2. If the sitemap loads, press Ctrl+U (or Cmd+U on Mac) to view the raw XML source. Every <loc> tag contains one URL.

Step 3. Copy the page source, paste it into a text editor, and use Find & Replace to strip the XML tags. Or run this one-liner in your browser console to extract every URL instantly:

// Paste into browser console on the sitemap page
const urls = [...document.querySelectorAll('loc')]
  .map(el => el.textContent);
console.log(urls.join('\n'));

💡 Tip: If /sitemap.xml returns a 404, check /robots.txt — most sites declare their sitemap location there, usually on a line that reads Sitemap: https://...

METHOD 2
Crawl With Screaming Frog SEO Spider

Screaming Frog is the gold standard for site crawling. It’s what I reach for on any site over a few dozen pages. The free version handles up to 500 URLs, which covers most small and mid-size sites.

Step 1. Download and open Screaming Frog. In the top bar, enter the site’s root URL (e.g., https://example.com) and click Start.

Step 2. Let the crawl finish. You’ll see the URL count ticking up in the bottom-left corner. For large sites this can take several minutes — don’t close it.

Step 3. Once done, go to the Internal tab at the top of the results table. This shows every internal URL discovered.

Step 4. Click Export (top right) → Export All → save as CSV. Open the CSV in Excel or Google Sheets — the URL column is column A.

⚠️ Warning: Screaming Frog only crawls URLs it can reach by following links. If a page is orphaned (no other page links to it) and isn’t in the sitemap, it won’t show up. For a truly complete inventory, combine Methods 1 and 2.

METHOD 3
Use wget on the Command Line

If you’re comfortable with a terminal, wget is a powerful one-liner that crawls a site and logs every URL it visits. No installs beyond wget itself, which comes pre-installed on Linux and macOS (Windows users can install it via GNU wget for Windows).

Run this command in your terminal:

wget --spider -r -nd -nv --no-cache \
  --reject-regex "(feed|category|tag|author|\?|#)" \
  https://example.com 2>&1 | grep '^--' | \
  awk '{ print $3 }' | sort -u > urls.txt

This tells wget to crawl recursively (-r) without downloading files (--spider), then pipes the log through awk to extract the URLs and sort -u to deduplicate them. The result lands in urls.txt in your current directory.

💡 Tip: Add --wait=1 to the command if you’re crawling a live production site — it adds a 1-second delay between requests so you don’t hammer the server.

METHOD 4
A Simple Python Script

When I need a reusable solution or want full control over filtering, I write a small Python crawler. This step trips up a lot of people who think it requires advanced coding — it really doesn’t. Here’s a script that does the job cleanly.

Step 1. Install the dependencies if you haven’t already:

pip install requests beautifulsoup4

Step 2. Save this as crawl.py and run it with python crawl.py:

import requests
from bs4 import BeautifulSoup
from urllib.parse import urljoin, urlparse

START_URL = "https://example.com"
visited = set()
to_visit = [START_URL]
domain = urlparse(START_URL).netloc

while to_visit:
    url = to_visit.pop(0)
    if url in visited:
        continue
    try:
        res = requests.get(url, timeout=8)
        visited.add(url)
        soup = BeautifulSoup(res.text, "html.parser")
        for tag in soup.find_all("a", href=True):
            link = urljoin(url, tag["href"])
            if urlparse(link).netloc == domain and link not in visited:
                to_visit.append(link)
    except Exception:
        pass

with open("urls.txt", "w") as f:
    for u in sorted(visited):
        f.write(u + "\n")

print(f"Done. {len(visited)} URLs saved to urls.txt")

📝 Note: This script does a breadth-first crawl and only follows links that stay on the same domain. It won’t follow external links or crawl subdomains unless you change the domain check. For very large sites, add a URL limit to avoid running for hours.

METHOD 5
Export From Google Search Console

This one only works for sites you own and have verified in Google Search Console. But when it applies, it’s incredibly useful — you’re getting the exact list of URLs Google has indexed, which is often what you actually care about.

Step 1. Log into Google Search Console and select your property.

Step 2. In the left sidebar, click Pages (under the Indexing section). This shows all URLs Google has discovered and indexed.

Step 3. Click the Export button in the top-right corner of the table, then choose Google Sheets, Excel, or CSV. The export includes the full URL list along with indexing status.

✅ Bonus: The Search Console export also flags which pages are excluded from the index and why (e.g., “Crawled — currently not indexed” or “Duplicate without canonical”). That context is pure gold during a site audit.

Quick Method Comparison

Method Needs site access? Best for Max URLs (free)
XML Sitemap No Quick check, any site Unlimited
Screaming Frog No SEO audits, GUIs 500 URLs
wget No Command line users Unlimited
Python script No Custom filtering Unlimited
Search Console Yes (owner only) Indexed URL list + status Unlimited

Pro Tips & Common Mistakes to Avoid

From experience — things people get wrong

  • Don’t crawl the same URL twice. Always deduplicate your final list. Query strings like ?ref=footer and ?ref=header are technically different URLs but the same page. Strip parameters before deduplicating.
  • Respect robots.txt. If you’re crawling someone else’s site, check /robots.txt first. Crawling paths marked Disallow is bad form and can get your IP blocked.
  • Don’t assume sitemap = full site. Sitemaps are maintained by humans. Pages that were never added, or orphaned pages from old content migrations, won’t appear. Use a crawl to cross-check.
  • Rate-limit your crawler on live sites. Hammering a site with requests too fast can trigger WAF blocks or, worse, cause real performance issues. A 1–2 second delay between requests is the polite standard.

📌 What You Can Do Now

You now have five solid methods for extracting every URL from a website — from a 60-second sitemap grab to a fully custom Python crawler. In my experience, combining the sitemap method with a Screaming Frog crawl catches about 99% of URLs on any well-structured site. Once you have your list, the natural next step is filtering it: remove non-canonical URLs, strip query parameters, and sort by page type. That clean list becomes the foundation for a redirect map, a content audit, or an SEO gap analysis.