I am getting unwanted blank lines between each row of scrapy output in the resulting csv output file.
I have moved from python2 to python 3, and I use Windows 10. I
The b
in w+b
is most probably part of the problem as this will make the file being considered a binary file and so linebreaks are written as is.
So first step is to remove the b
. And then by adding U
you can also activate the Universal Newline support ( see: https://docs.python.org/3/glossary.html#term-universal-newlines )
So the line in question should look like:
file = open('%s_items.csv' % spider.name, 'Uw+')