Is there a way to write data to CSV without repeating data? (Using Python)

Viewed 65

I am working on a webscraping project in python. I have managed to get the data in the command line, now that it is time to put it into excel/.csv, I tried using import csv and opening file in append mode. It worked but when run again, adds repetitive data. How will be the best way to avoid that and make it efficient?

Output:

Status,School,Details
Accepted,Notre Dame / Mendoza,GMAT: 690 Round: Round 4 | Midwest
Note,Vanderbilt / Owen,GRE: 318 Round: Round 2
Waitlisted,Dartmouth / Tuck,GMAT: 720 Round: Round 2
Waitlisted,Vanderbilt / Owen,GPA: 3.4 Round: Round 3 | Ohio
Waitlisted,Vanderbilt / Owen,GPA: 3.84 GMAT: 720 Round: Round 3 | Ohio
Accepted,Vanderbilt / Owen,"GPA: Grad:  4.00 / Undergrad:  3.57 GRE: 319 Round: Round 3 | Nashville, TN"
Rejected,UT Austin / McCombs,GPA: 3.5 Round: Round 3 | Canada
Accepted,Vanderbilt / Owen,GPA: 3.5 GRE: 315 Round: Round 3 | Mid West
Accepted,Georgia Tech / Scheller,GPA: 3.0 Round: Round 3 | NYC/Texas
Accepted,Rice / Jones,GPA: 3.4 GMAT: 700 Round: Round 3 | Texas
Accepted,Rice / Jones,"GPA: 3.27 GRE: 308 Round: Round 3 | Houston, TX"
0 Answers
Related