minimaxir / facebook-page-post-scraper

Data scraper for Facebook Pages, and also code accompanying the blog post How to Scrape Data From Facebook Page Posts for Statistical Analysis
2.12k stars 663 forks source link

Blank rows between observations in CSV export? #80

Closed dsynkov closed 6 years ago

dsynkov commented 6 years ago

Is anyone getting blank rows in the CSV export for any of the scrapers (i.m. seeing these for all three -- Comments, Page Status Updates, and Group Status Updates). There is a blank row in between each observation. This is an easy fix in Excel or if I'm re-importing an export as a dataframe, but I'm wondering if anyone has found a fix using the CSV writer already in the code. Thanks.

gielk commented 6 years ago

same issue

kasamoh commented 6 years ago

Hi , Just use file = open('%s_file_name.csv' % page_id, 'w',newline='') instead of file = open('%s_file_name.csv' % page_id, 'w') ( I added newline='' ) . Hope it helps . Regards

dsynkov commented 6 years ago

Thanks @kasamoh, this worked for me.