This repo is not a scraping library, it is just a wrapper script to make the facebook-scraper work for scraping fb group posts (NOT group members).
- Install library using
pip install -r requirements.txt - Install extension "Get cookies.txt LOCALLY" in Chrome or Firefox.
- Open https://mbasic.facebook.com/, use the extension to download the cookies to local.
- Open your download folder, copy the file to this repo and change the "cookie" parameter in "scraper_csv.py" to the newly downloaded cookie file name.
- Change the group id to your desired group id
- If you want to start from fresh, delete "next_page.txt" and all "messages_*.csv" in folder "data". This ensures the data start from scratch. Else, if you want to continue from the previous scraping progress, don't delete the files, and adjust the
page_startvariable in the code. - Change the number of page in
python scraper_csv.pyif required. - Run
python scraper_csv.py - After finished, you can merge the csv by running
bash data/merge.bash, or trim the columns by runningpython csv_process.py