0
from shodan import WebAPI
SHODAN_API_KEY = "MY API KEY"
api = WebAPI(SHODAN_API_KEY)
host = api.host('98.111.2.190')
# Print general info
try:
print """
IP: %s
Country: %s
City: %s
""" % (host['ip'], host.get('country', None), host.get('city', None))
except WebAPIError:
print "No information available for that IP."
我得到shodan.api.WebAPIError: No information available for that IP.
當它無法找到數據庫中的IP,我怎麼能提出這個異常打印出來,沒有該ip的信息。如何提出此異常