DEV Community

wojtek
wojtek

Posted on

How to Automate B2B Lead Generation & Extract Contact Details with Python

Finding fresh B2B leads and gathering contact details (emails, phone numbers, social media links) is often one of the most time-consuming tasks for sales, marketing, and recruitment teams.

In this guide, I’ll show you how to automate contact extraction from business websites using the Lead Generator & Contact Extractor Actor on Apify.


🎯 What Does the Lead Generator Do?

Instead of manually browsing websites to copy-paste email addresses and phone numbers, this tool automatically scans target pages and extracts:

  • ✉️ Email Addresses (filtered and cleaned)
  • 📞 Phone Numbers
  • 🔗 Social Media Profiles (LinkedIn, Twitter/X, Facebook, Instagram)
  • 🌐 Website Metadata & Contact Page Links

⚡ How to Extract Leads in 3 Easy Steps

  1. Open the Actor: Go to Apify Console and find the Lead Generator & Contact Extractor.
  2. Provide Start URLs: Enter the URLs of the websites or company directories you want to scrape.
  3. Run & Export: Click Start. Download your list of qualified leads directly as CSV, Excel, or JSON.

📤 Sample JSON Output

Here is an example of the structured contact data you receive:


json
[
  {
    "url": "https://example-company.com
    "emails": ["contact@example-company.com", "sales@example-company.com"],
    "phones": ["+48 123 456 789"],
    "social_links": {
      "linkedin": "https://linkedin.com/company/example
      "twitter": "https://x.com/example"
    }
  }
]

Enter fullscreen mode Exit fullscreen mode

Top comments (0)