擅长:python、mysql、java
<p>您需要实例化<code>Shodan</code>类,然后才能使用它的<code>Shodan.info()</code>方法。下面是它在官方命令行界面中的外观:</p>
<p><a href="https://github.com/achillean/shodan-python/blob/master/shodan/__main__.py#L364" rel="nofollow noreferrer">https://github.com/achillean/shodan-python/blob/master/shodan/__main__.py#L364</a></p>
<p>以下是打印当前帐户使用信息的简短脚本:</p>
<pre class="lang-py prettyprint-override"><code>import pprint
import shodan
key = 'YOUR API KEY'
api = shodan.Shodan(key)
results = api.info()
pprint.pprint(results)
</code></pre>