I am new to python
Here is my attempt
import urllib2
email_id = input("enter the email id")
content = urllib2.urlopen('https://somewebsite.com/uniqueEmail?email={email_id}.format(email_id=email_id)').read()
print content
if content.find('"uniqueEmail":false') == True:
print("email exists")
else:
print("email doesnt exists")
when the print content code executes my website will display
{"params":{"method":"GET","controller":"GlobalUsers","action":"uniqueEmail","email":"theemailaddress_entered"},"uniqueEmail":true}
so if uniqueEmail prints out true or false depending upon if the email exists.
Now my doubt is
I know I did wrong in passing the email id variable through the parameter in the URL.
and second is how to check if the value was true or false ?
find()doesn't return True or False. It returns a number. Look at the documentation. What's more, this is JSON, which you can parse.