Reputation: 11
I have installed python 2.7, IPWhois etc.
I can get anwer to IP address: 74.125.225.229.
But I can't get anwer for IP: 1.209.148.1.
Can anyone help?
Python 2.7.9 (default)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from ipwhois import IPWhois
ip = '74.125.225.229'
obj = IPWhois( str(ip) )
res=obj.lookup_whois()
print(res)
{'raw': None, 'asn_registry': 'arin', 'asn_country_code': 'US', 'asn_date': '2007-03-13', 'asn_cidr': '74.125.225.0/24', 'raw_referral': None, 'nir': None, 'query': '74.125.225.229', 'referral': None, 'nets': [{'updated': '2012-02-24', 'handle': 'NET-74-125-0-0-1', 'description': 'Google Inc.', 'postal_code': '94043', 'address': '1600 Amphitheatre Parkway', 'cidr': '74.125.0.0/16', 'emails': ['[email protected]', '[email protected]'], 'city': 'Mountain View', 'name': 'GOOGLE', 'created': '2007-03-13', 'country': 'US', 'state': 'CA', 'range': '74.125.0.0 - 74.125.255.255'}], 'asn': '15169'}
ip = '1.209.148.1'
obj = IPWhois( str(ip) )
res=obj.lookup_whois()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/.../src/ipwhois/ipwhois/ipwhois.py", line 184, in lookup_whois
field_list=nir_field_list, is_offline=False
File "/.../src/ipwhois/ipwhois/nir.py", line 497, in lookup
form_data=form_data
File "/.../src/ipwhois/ipwhois/net.py", line 977, in get_http_raw
request_type=request_type, form_data=form_data
File "/.../src/ipwhois/ipwhois/net.py", line 931, in get_http_raw
form_data = urlencode(form_data)
File "/usr/lib/python2.7/urllib.py", line 1324, in urlencode
raise TypeError
TypeError: not a valid non-string sequence or mapping object
Upvotes: 1
Views: 634
Reputation: 19395
From the comments (edited):
Solved it. It was a problem with iptables/firewall. Thanks for the help.- th3V
Upvotes: 1