DEV Community

loading...

Scraping emails in python

personic75
・1 min read

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

Discussion (1)

Collapse
dimitryzub profile image
Dimitry 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