Skip to content

Commit f3ea346

Browse files
author
Junjie Tao
committed
Update 3-scrapeCsv.py
newline='' was also necessary, and so encoding='utf-8' was on Windows system.
1 parent 38040ef commit f3ea346

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chapter5/3-scrapeCsv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
table = bsObj.findAll("table",{"class":"wikitable"})[0]
99
rows = table.findAll("tr")
1010

11-
csvFile = open("files/editors.csv", 'wt')
11+
csvFile = open("files/editors.csv", 'wt', newline='', encoding='utf-8')
1212
writer = csv.writer(csvFile)
1313
try:
1414
for row in rows:

0 commit comments

Comments
 (0)