Im trying to write a code, that will be able to verify domain through whois.domaintools.com.
But theres a little problem with reading the html, that do not match with whois.domaintools.com/notregistereddomain.com source code. Whats wrong? Its problem with requsting or what? I really dont know how to solve it.
import urllib2
def getPage():
url="http://whois.domaintools.com/notregistereddomain.com"
req = urllib2.Request(url)
try:
response = urllib2.urlopen(req)
return response.read()
except urllib2.HTTPError, error:
print "error: ", error.read()
a = error.read()
f = open("URL.txt", "a")
f.write(a)
f.close()
if __name__ == "__main__":
namesPage = getPage()
print namesPage