python-scraping icon indicating copy to clipboard operation
python-scraping copied to clipboard

Indentation Error (Storing Data, 4th code)

Open chikoungoun opened this issue 7 years ago • 0 comments

On the second loop there is a slight indentation issue to have the proper form

csvFile = open('editors.csv', 'wt+')
writer = csv.writer(csvFile)
try:
    for row in rows:
        csvRow = []
        for cell in row.findAll(['td', 'th']):
            csvRow.append(cell.get_text())
        writer.writerow(csvRow) #it should be indented backward to have a proper csv form
finally:
    csvFile.close()

chikoungoun avatar May 23 '18 12:05 chikoungoun