DEV Community

personic75
personic75

Posted on

Scraping emails in python

Guys

how to extract emails using google search string ...

Query

site linkedin.com python developer india "@gmail.com"

i need to extract emails from this query

thanks

Top comments (1)

Collapse
 
dmitryzub profile image
Dmitriy Zub ☀️ • Edited

To extract @gmail.com from the string you can use regex, or partition() method.

Examples below uses regex, and you can test them in the online IDE here (small example for better understanding), and real example here, that scrapes title, link, email, rating, votes, price range from Google Search.

Ouput will look like this:

  {
    "Title": "Spinelli Dental - General Dentist - Rochester, New York ...",
    "Link": "https://www.facebook.com/spinellidental/about/?referrer=services_landing_page",
    "Email": "spinellidental@gmail.com",
    "Rating": "Rating: 5",
    "Votes": "10 votes",
    "Price_range": null
  }
Enter fullscreen mode Exit fullscreen mode