- Oct 19, 2026
- 3 min read
Finding a Business Email on Its Own Website (Including the Ones Cloudflare Hides)
Enrichment databases sell email addresses, often guessed from name patterns and of unknown origin. For a lead list I want to defend (the legal side), I wanted something simpler: the address the business itself publishes for contact, on its own website.
Where to look
Most small business sites put the address in one of a few places:
CONTACT_PATHS = ["", "contact", "contact-us", "contact/", "contact-us/", "about", "about-us"]
Stop at the first page that yields a usable address. Send a real
User-Agent naming who’s checking; some sites, and Cloudflare’s bot
protection, block Python’s default one.
Three ways an address hides in HTML
def emails_in(page):
found = set()
# 1. mailto: links (decode %40 and friends; drop ?subject=…)
for m in re.findall(r'href="mailto:([^"?]+)', page, re.I):
found.add(urllib.parse.unquote(m))
# 2. Cloudflare Email Obfuscation: <a data-cfemail="…">[email protected]</a>
for m in re.findall(r'data-cfemail="([0-9a-f]+)"', page, re.I):
found.add(cf_decode(m))
# 3. Plain text, with the tags stripped
text = html.unescape(re.sub(r"<[^>]+>", " ", page))
found.update(EMAIL_RE.findall(text))
return {e.strip().lower() for e in found if EMAIL_RE.fullmatch(e.strip()) and not JUNK.search(e)}
Cloudflare’s obfuscation is common on small business sites, and it’s trivial to reverse: the first byte is a key, and every following byte is XORed with it.
def cf_decode(hexstr):
key = int(hexstr[:2], 16)
return "".join(chr(int(hexstr[i:i + 2], 16) ^ key) for i in range(2, len(hexstr), 2))
Junk shows up too: image names like [email protected], error-tracking
addresses from scripts, template placeholders ([email protected]). A small
deny pattern removes them.
Which address to keep
A page can list several addresses: a supplier, a web designer, a personal Gmail. Two rules:
- Own domain only. The address must belong to the site’s domain, in
either direction:
[email protected]onwww.company.co.ukorshop.company.co.uk, but not[email protected]and never a free-mail address. (For UK cold email a free-mail address is also a hint of a sole trader, who would need consent.) - Role addresses first.
info@,hello@,contact@,enquiries@,reception@before named ones: they’re published for exactly this, and they reach whoever handles new business.
def same_site(email_domain, host):
d = email_domain.removeprefix("www.")
return d == host or host.endswith("." + d) or d.endswith("." + host)
own = [e for e in candidates if same_site(e.split("@")[1], host)]
best = sorted(own, key=lambda e: (not ROLE.match(e), len(e)))[0]
My first version only accepted subdomains of the email’s domain, and so
rejected [email protected] found on consulting.company.com. Test the
matcher both ways.
Results
On 26 small business sites in one niche: 16 had a usable address, half of them role addresses. The other ten published only a form, a phone number or an address on another domain. That’s fine: no address, no email.
Takeaways
- The business’s own site is the most defensible source of a business address.
- Decode Cloudflare’s obfuscation; it hides a lot of small-business addresses from naive scrapers.
- Keep only own-domain addresses, role addresses first.
- Record where each address came from. If someone asks, you can answer.