DEV Community

Siftwright
Siftwright

Posted on

Where do websites hide their contact email? I checked 50 sites (and the 174 fake addresses a regex finds)

Most "find the contact email for this website" scripts fetch the homepage, run an email regex, and give up. I wanted to know how much that misses, so I measured it on 50 well-known company and project websites (SaaS, hosting, open-source foundations) on 25 November 2026.

The numbers

Of the 50 sites, 3 refused or timed out a plain HTTP client, so 47 were usable.

Where the script looked Sites with at least one address
Homepage only 11 of 47 (23%)
Homepage + links in the page whose URL or text says contact / support / help / about / legal / imprint 33 of 47 (70%)
...+ guessed paths (/contact, /contact-us, /about, /legal, /support, /impressum) 38 of 47 (81%)

So the homepage alone found an address for fewer than a quarter of the sites. Following the site's own navigation links tripled that. Guessing common paths added five more sites (one had no links in its server-rendered HTML at all; the others did not link a matching page from the homepage). Following links also found four sites that path guessing alone would have missed, because their pages live at paths like /support.html or deep under /company/.

The remaining 9 sites publish no address in plain HTML: they use a contact form, a help-centre widget, or render everything with JavaScript. A regex cannot fix that, and you should not try to guess info@ for them.

The false positives are the bigger problem

A naive [\w.+-]+@[\w-]+\.[\w.]+ over raw HTML returned plenty of things that are not email addresses. Across the 50 sites my filter rejected:

  • 174 image file names such as career-dark@2x.avif or logo@3x.png. Retina asset names look exactly like addresses. One site alone produced 84 of them across the pages crawled.
  • 26 placeholders and vendor ids (@example.com, error-tracker and site-builder hosts).
  • 11 hash-like local parts such as a 32-character hex id at an errors subdomain: an error-tracker DSN, not a mailbox.

Two more traps that do not show up as "rejects" but corrupt the results:

  • JSON-escaped strings. Addresses inside inline JSON often come out with a trailing backslash (press@...com\), so the same address appears twice. Strip it before de-duplicating.
  • Cloudflare email obfuscation. Sites behind Cloudflare can replace addresses with <a data-cfemail="...">. The hex is XOR-encoded with the first byte as the key, so it is a three-line decode. Only 1 of these 50 sites used it, but on small-business sites it is far more common.

The script (stdlib only, ~65 lines)

It fetches the homepage, then the site's own contact-like links, then guessed paths, and stops at the first page that yields an address so it does not crawl more than it needs to.

import html, re, sys, urllib.parse, urllib.request

UA = "Mozilla/5.0 (compatible; contact-finder/1.0)"
EMAIL = re.compile(r"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,24}")
ASSET = re.compile(r"\.(png|jpe?g|gif|svg|webp|avif|css|js)$", re.I)
NAV = re.compile(r"contact|support|help|about|imprint|impressum|legal", re.I)
GUESS = ["/contact", "/contact-us", "/about", "/legal", "/support", "/impressum"]

def fetch(url):
    try:
        req = urllib.request.Request(url, headers={"User-Agent": UA})
        with urllib.request.urlopen(req, timeout=12) as r:
            return r.read(1_500_000).decode("utf-8", "replace"), r.geturl()
    except Exception:
        return None, None

def cf_decode(h):  # Cloudflare email obfuscation: first byte is the XOR key
    k = int(h[:2], 16)
    return "".join(chr(int(h[i:i + 2], 16) ^ k) for i in range(2, len(h), 2))

def clean(e):
    e = e.strip().strip(".\\").lower()          # JSON-escaped strings leave a trailing "\"
    local, _, domain = e.partition("@")
    if not domain or ASSET.search(e):            # logo@2x.avif, hero@3x.png ...
        return None
    if re.fullmatch(r"[0-9a-f]{16,}", local):    # error-tracker DSNs, hashed ids
        return None
    if domain.startswith(("example.", "sentry", "wixpress")):
        return None
    return e

def emails_in(body):
    found = [cf_decode(h) for h in re.findall(r'data-cfemail="([0-9a-fA-F]+)"', body)]
    found += [urllib.parse.unquote(m) for m in re.findall(r'mailto:([^"\'?>\s]+)', body)]
    found += EMAIL.findall(html.unescape(body))
    return {e for e in map(clean, found) if e}

def nav_links(body, base, domain):
    links = []
    for href, text in re.findall(r'<a[^>]+href="([^"#]+)"[^>]*>(.*?)</a>', body, re.S | re.I):
        label = re.sub(r"<[^>]+>", " ", text)
        if NAV.search(href) or NAV.search(label):
            url = urllib.parse.urljoin(base, html.unescape(href))
            u = urllib.parse.urlparse(url)
            if u.netloc.endswith(domain) and u.path not in ("", "/") and url not in links:
                links.append(url)
    return links

def find_contact_emails(domain, max_pages=8):
    home, base = fetch(f"https://{domain}/")
    if home is None:
        return {"domain": domain, "status": "blocked", "emails": []}
    emails, pages = emails_in(home), ["/"]
    candidates = nav_links(home, base, domain)[:6]
    candidates += [f"https://{domain}{p}" for p in GUESS]
    for url in candidates:
        if emails or len(pages) >= max_pages:  # stop at the first page that has an address
            break
        body, _ = fetch(url)
        if body:
            pages.append(urllib.parse.urlparse(url).path)
            emails |= emails_in(body)
    return {"domain": domain, "status": "ok", "pages": pages, "emails": sorted(emails)}

if __name__ == "__main__":
    for d in sys.argv[1:]:
        print(find_contact_emails(d))
Enter fullscreen mode Exit fullscreen mode

Run it:

python3 find_emails.py letsencrypt.org sqlite.org buffer.com
Enter fullscreen mode Exit fullscreen mode

Real output (addresses masked here):

{'domain': 'letsencrypt.org', 'status': 'ok', 'pages': ['/', '/about/', '/repository/'], 'emails': ['<x>@letsencrypt.org']}
{'domain': 'sqlite.org', 'status': 'ok', 'pages': ['/', '/support.html'], 'emails': ['<x>@hwaci.com']}
{'domain': 'buffer.com', 'status': 'ok', 'pages': ['/', '/ai-assistant', '/about', '/legal'], 'emails': ['<x>@buffer.com', ...]}
Enter fullscreen mode Exit fullscreen mode

Note the sqlite.org case: the address is on a different domain from the website. Do not drop off-domain addresses blindly; drop them only when they are obviously a vendor (privacy representatives, error trackers).

Limits worth knowing

  • Soft 404s. Many sites return 200 for /contact-us even when the page does not exist, so "the page loaded" says nothing. Count addresses, not status codes.
  • JavaScript-only sites need a browser. Plain HTTP saw nothing on several modern sites.
  • Bot protection. 3 of 50 sites (6%) refused a plain client outright. Respect that rather than working around it.
  • Personal data. A named employee's address is personal data under GDPR and similar laws. For outreach, prefer role addresses (sales@, press@, support@) and keep a lawful basis for anything else.

If you do not want to maintain this

  • Try one site in the browser, free and without signing up: siftwright.com/tools/contact-finder. It also returns phone numbers and social profiles.
  • For a list of websites, the Contact Details Extractor on Apify does the same homepage + contact/about crawl with the false-positive filtering above, charges per website that returns a result, and failed sites are free.

Disclosure: I build both of those. The script above is complete on its own and is free to reuse.

Top comments (0)