Saving the data to the CSV file

PHOTO EMBED

Tue May 21 2024 15:36:30 GMT+0000 (Coordinated Universal Time)

Saved by @Uncoverit #python

# Saving the data to the CSV file

with open(csv_file, 'w', newline='', encoding='utf-8') as csvfile:
    writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
    writer.writeheader()
    for data in all_perfume_data:
        writer.writerow(data)

print('Data saved to:', csv_file)
content_copyCOPY