Skip to main content

How to Extract Emails, Phones and Socials from Websites

Learn how to extract contact details from website lists using Python and Apify, with pricing at $0.60 per 1,000 results.

AI-written
Inewgen
12 Nov 2026Source: Dev.to3 min read (0 view)
Share
How to Extract Emails, Phones and Socials from Websites

Stock photo for illustration only, not from the actual event

Font size
  • Contact extraction can be done manually or via automated website scrapers.
  • Basic Python scripts often miss contact pages and collect junk data.
  • The Apify Contact Details Scraper automates crawling and charges only when contacts are found.
  • Pricing is set at $0.60 per 1,000 results while automatically skipping duplicate domains.

Extracting emails from a website typically starts by visiting its home, contact, imprint, and about pages to copy the listed addresses manually. For a single site, this approach works well, but handling hundreds or thousands of corporate websites requires a contact details scraper that crawls those pages and returns a structured table. This allows users to review emails, phone numbers, social media links, and their exact source pages before launching any outreach campaigns.

Websites do not function as databases equipped with dedicated email endpoints. Instead, businesses publish their contact details as standard page content, such as footer mailto links, contact page phone numbers, or social profile links, without any public API that returns domain details upon request. Available tools simply read these pages and return only the information explicitly published by the website itself without guessing or generating addresses.

Extracting contact details at scale presents challenges due to varying HTML layouts across websites. Utilizing established scraping tools streamlines data cleaning and filters out irrelevant pages more efficiently than building a custom script from scratch, minimizing blocking risks and ensuring precise budget control.

code editor programming screen python

Stock photo for illustration only, not from the actual event

Writing a short Python script to download a home page and match email patterns using regular expressions is straightforward, but such scripts break easily on real-world sites. They typically read only a single page, missing contact pages while picking up junk data like image filenames and placeholder addresses, and failing to capture phone numbers or social profiles. Fixing all these edge cases requires a dedicated development effort.

Never miss the latest news?

Subscribe to get news summaries by email - not often enough to be annoying.

Advertisement

Hosted scraping tools like the Contact Details Scraper on Apify handle the crawling, cleaning, and formatting processes, returning clean spreadsheets or JSON data. The scraper accepts a list of URLs or bare domains and bills only for websites where contact information is successfully found, automatically skipping duplicate domains such as example.com and www.example.com to produce a single row.

$0.60per 1,000 results
5max pages per domain

The scraper reads HTML directly without running a full browser. Sites requiring JavaScript execution to display contact details return a js_only status, while bot-protected pages return a blocked status, and neither incurs any charges. Clients can be installed via pip install apify-client and configured by storing an API token in the APIFY_TOKEN environment variable before invoking the actor.

Pricing is established at $0.60 per 1,000 results, equivalent to $0.0006 per website, where a single result represents a website row with an ok status containing at least one email, phone number, or supported social profile. Rows returning no_contacts, blocked, js_only, not_found, or error remain in the dataset marked as billed: false at no cost. Users can also configure a maximum cost limit per run on Apify to ensure the scraper terminates cleanly once the specified budget is reached.

Source: Dev.to

Comments

Leave a Comment
0/2000

Found something wrong in this article? Report an issue with this article