I wanted to check if a certain website exists, this is what I\'m doing:
user_agent = \'Mozilla/20.0.1 (compatible; MSIE 5.5; Windows NT)\' headers = { \'User
Try this one::
import urllib2 website='https://www.allyourmusic.com' try: response = urllib2.urlopen(website) if response.code==200: print("site exists!") else: print("site doesn't exists!") except urllib2.HTTPError, e: print(e.code) except urllib2.URLError, e: print(e.args)