python批量获取oneforall报告文件中域名的脚本

import os
import csv

data = []
path = '/Users/apple/36/OneForAll-master/results/csv'
dirs = os.listdir(path)
for name in dirs:
    with open(os.path.join(path, name), 'r') as csvfile:
        reader = csv.reader(csvfile)
        column = [row[5] for row in reader]
        del column[0]
        data += column

data = sorted(list(set(data)), key=data.index)
for d in data:
    print(d)
posted @ 2022-03-04 09:12  总得前行  阅读(152)  评论(0编辑  收藏  举报