限制搜索(python)
问题描述:
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个结果?限制搜索(python)
答
for exploit in results['matches'][:5]:
print '%s:' % (exploit['description'])