Merge pull request #748 from duhaode520/master
🐞 fix(谷歌学术搜索): 包装search.results()为空可能造成的报错
			
			
This commit is contained in:
		
						commit
						5f79fed566
					
				@ -36,6 +36,7 @@ def get_meta_information(url, chatbot, history):
 | 
			
		||||
            max_results = 1,
 | 
			
		||||
            sort_by = arxiv.SortCriterion.Relevance,
 | 
			
		||||
        )
 | 
			
		||||
        try:
 | 
			
		||||
            paper = next(search.results())
 | 
			
		||||
            if string_similar(title, paper.title) > 0.90: # same paper
 | 
			
		||||
                abstract = paper.summary.replace('\n', ' ')
 | 
			
		||||
@ -44,6 +45,9 @@ def get_meta_information(url, chatbot, history):
 | 
			
		||||
                abstract = abstract
 | 
			
		||||
                is_paper_in_arxiv = False
 | 
			
		||||
            paper = next(search.results())
 | 
			
		||||
        except:
 | 
			
		||||
            abstract = abstract
 | 
			
		||||
            is_paper_in_arxiv = False
 | 
			
		||||
        print(title)
 | 
			
		||||
        print(author)
 | 
			
		||||
        print(citation)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user