<p>我正在使用<code>from scholarly import scholarly</code>从谷歌学者那里获取教授列表中25位教授的引用次数。然而,有些作者没有引文。我如何能够循环并停止迭代。我已尝试使用以下代码:</p>
<pre><code>for i in professorlist:
if i in professorlist:
a = scholarly.search_author(i)
author = next(search_query)
scholarly.pprint(scholarly.fill(author, sections=['counts']))
if i not in professorlist:
print ("no citations")
</code></pre>
<p>但我得到了这个错误:</p>
<pre><code>---------------------------------------------------------------------------
StopIteration Traceback (most recent call last)
<ipython-input-636-b3aa9d644e9f> in <module>
2 if i in professorlist:
3 a = scholarly.search_author(i)
----> 4 author = next(search_query)
5 scholarly.pprint(scholarly.fill(author, sections=['counts']))
6 if i not in professorlist:
StopIteration:
</code></pre>