Skip to content

Commit

Permalink
Update chafofa.py
Browse files Browse the repository at this point in the history
解决由于语法过长出现的xls报错问题
  • Loading branch information
langsasec authored Jan 13, 2023
1 parent cf3ec59 commit c611ae9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chafofa.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ def chafofa(f, s):
dict_data = json.loads(res) # json转成python字典
results = dict_data.get('results')
book = xlwt.Workbook(encoding='utf-8', style_compression=0)
sheet = book.add_sheet(f'{f}_fofa查询结果', cell_overwrite_ok=True)
sheet = book.add_sheet(f'fofa查询结果', cell_overwrite_ok=True)
col = ('IP', 'host', '端口', '协议', '网站标题', '网站server')
for i in range(0, 6):
sheet.write(0, i, col[i])
for i in range(len(results)):
data=results[i]
for j in range(0, 6):
sheet.write(i+1, j, data[j])
path=f'{f}_{str(time.time().__hash__())}_fofa查询结果.xls'
path=f'{str(time.time().__hash__())}_fofa查询结果.xls'
book.save(path)
print(f"表格已保存为{path}")

Expand Down

0 comments on commit c611ae9

Please sign in to comment.