Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quake api未返回对应字段导致报错 #120

Closed
Zimba5880 opened this issue Aug 11, 2022 · 2 comments
Closed

quake api未返回对应字段导致报错 #120

Zimba5880 opened this issue Aug 11, 2022 · 2 comments

Comments

@Zimba5880
Copy link

Zimba5880 commented Aug 11, 2022

使用quake api查询部分域名时会报以下错误
image

测试发现似乎是quake api有时候返回的data里可能出现不存在service.http.title这个字段导致的

文件路径:

Plugins\infoGather\WebspaceSearchEngine\quakeApi.py

相关代码:

if 'http' in service.keys():
    http = service['http']
    host = http['host'] 
    title = http['title']  # 此处为报错的第62行,由于返回数据里可能没有title这个字段导致报错

经测试使用dict get方法后即可正常运行,建议改成以下形式:

if 'http' in service.keys():
    http = service['http']
    host = http['host'] 
    title = http.get('title','not exist') 
@SkewwG
Copy link
Contributor

SkewwG commented Aug 12, 2022

感谢师傅反馈,已修复

@2328956238
Copy link

感谢,师傅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants