I have downloaded a csv file from an url and used csv.reader to read its content. However I am getting _csv.Error: line contains NUL when I try to iterate over the _csv.reader object.
I have to mention that if I manually copy paste (ctrl+a, ctrl+c and ctrl+v ) the contents of the csv manually to a different csv the code works.
This is the code so far.
import csv
import requests
url='https://sedo.com/fileadmin/documents/resources/expiring_domain_auctions.csv'
response=requests.get(url)
with open('downloaded_csv.csv','wb') as out_file:
out_file.write(response.content) # file is written properly in disk, can open with editor
with open('downloaded_csv.csv',newline='') as in_file:
csv_contents=csv.reader(in_file,delimiter=';')
print((csv_contents))
for row in csv_contents: # _csv.Error: line contains NUL
print(row)
Can anyone tell me how I can read the contents of this file in my python program?