from shodan import WebAPI
SHODAN_API_KEY = "MY API KEY"
api = WebAPI(SHODAN_API_KEY)
results = api.exploitdb.search('PHP')
print 'Results found: %s' % results['total']
for exploit in results['matches']:
print '%s:' % (exploit['description'])
如何将搜索限制为仅打印前5个结果?
答案 0 :(得分:5)
for exploit in results['matches'][:5]:
print '%s:' % (exploit['description'])
答案 1 :(得分:0)
花点时间学习有关列表和“切片”的Python基础知识: