【发布时间】:2019-09-12 09:37:53
【问题描述】:
我需要使用 shodan API 执行 BULK whois 查询。
我遇到了这段代码
import shodan
api = shodan.Shodan('inserted my API-KEY- within single quotes')
info = api.host('8.8.8.8')
运行模块后出现以下错误:
回溯(最近一次通话最后一次):
中的文件“C:/Users/PIPY/AppData/Local/Programs/Python/Python37/dam.py”,第 1 行 进口小单
中的文件“C:/Users/PIPY/AppData/Local/Programs/Python/Python37\shodan.py”,第 2 行 api = shodan.Shodan('上面插入的 API KEY')
AttributeError: 模块 'shodan' 没有属性 'Shodan'
我正在学习 python,但脚本/编程经验有限。
你能帮帮我吗?
干杯
【问题讨论】:
-
您是如何安装
shodan库的? -
在我使用过的命令提示符中:pip install shodan 然后 shodan init "my api key" 并且 o/p 是"成功初始化"