From 84789928d1ed3b0ec6aabd8aff0120b783f93b20 Mon Sep 17 00:00:00 2001 From: chrism01 Date: Tue, 6 Aug 2024 21:30:57 +0200 Subject: [PATCH] Bug fixes csv Output --- csv_helper.py | 5 ++++- helper.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/csv_helper.py b/csv_helper.py index 55560ae..5f5c832 100644 --- a/csv_helper.py +++ b/csv_helper.py @@ -51,7 +51,10 @@ def write_rows_to_csv(prepared_output): try: with open(ABSOLUTE_FILE_PATH + OUTPUT_FILENAME, mode='w', newline='') as file: writer = csv.writer(file, delimiter=",") - + # Add header Row + # Define the headers for the CSV file + headers = ["URL", "MX Record", "SPF Record", "DKIM Record", "DMARC Record"] + writer.writerow(headers) # Write the URL information to the CSV file if len(prepared_output) > 1: for url_info in prepared_output: diff --git a/helper.py b/helper.py index 28ae7f8..fbfc88e 100644 --- a/helper.py +++ b/helper.py @@ -14,8 +14,8 @@ def remove_new_line_char(domains): def replace_characters(record_to_check): - char_to_replace = "," - new_char = ";" + char_to_replace = ";" + new_char = "," # for record in record_to_check: updated_string = record_to_check.replace(char_to_replace, new_char) return updated_string