I'm trying to automate reverse-ip lookups on domaintools.com. Everything is fine, except that I don't exactly get the data I want after I submit a post to the site. I know the post is correct, the return data just doesn't appear on the post. Not sure what to do at this point. Here is the code:
#!/usr/bin/env python import urllib2, urllib, httplib, cookielib h=urllib2.HTTPHandler(debuglevel=1) cj = cookielib.MozillaCookieJar() ##Add some data to the url data = urllib.urlencode({'hostname': 'google.com'}) ##Add a cookie handler cookieHandler = urllib2.HTTPCookieProcessor(cj) redirectionHandler = urllib2.HTTPRedirectHandler() ##Creating a request object - takes url of resource I want to retrieve request = urllib2.Request('http://www.domaintools.com/research/reverse- ip/', data) ##adding useragent to request object request.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15') ##Creating a url opener; can take an number of handlers, which control how responses are handled opener = urllib2.build_opener(h, cookieHandler, redirectionHandler) ##tell the opener to open the url response = opener.open(request) text = response.read() print text -- http://mail.python.org/mailman/listinfo/python-list