I am trying to make a function that takes in potential email addresses and searches them on google and produces a true value if it finds the exact email address in the website. The code would take in an email address like these listed below and search each one and if it finds an exact match on google produces the true value for that email.
['Jane.Doe@gmail.com',
'JaneDoe@gmail.com',
'Jane@gmail.com',
'JaneD@gmail.com',
'JDoe@gmail.com',
'DoeJ@gmail.com',
'DoeJa@gmail.com']
I have found some code that does the google search part, but I want it to only produce true or show results if the email address is exactly the same. Currently, I will produce results that are just the name of the person or not the email iteration that I search for specifically. I am not sure if this is possible, but any suggestions would be greatly appreciated. The search code is listed below.
try:
from googlesearch import search
except ImportError:
print("No module named 'google' found")
# to search
query = "some_email@gmail.com"
for j in search(query, tld="co.in", num=10, stop=10, pause=2):
print(j)