Skip to main content

Python and selenium based (mobile) Facebook groups scraper, independent of obfuscated css selectors.

Project description

Facebook group scraper

A simple selenium-dependent python scraper for Facebook groups.

Requirements:

  • Python 3.6 or newer
  • Selenium (automatically installed)

Installing

# pypi
pip3 install fbgs

# local
git clone https://github.com/lesander/facebook-group-scraper.git
cd facebook-group-scraper/
pip3 install -r requirements.txt

Usage

Cli usage:

# local & pypi
python3 -m fbgs \
--username user@example.com \
--password "example-password" \
--url https://m.facebook.com/groups/group-name \
--output ./path/for/output.json \
--no-shell  # toggle to disable default selenium interactive prompt

Programmatic usage:

from fbgs import FacebookScraper
from fbgs.exceptions import ScraperException
try:
    scraper = FacebookScraper(
        username="user@example.com", password="example-password")
    scraper.login()
    g = scraper.scrape_group(url="https://m.facebook.com/groups/group-name", out="output-example.json")
    scraper.interactive()
except ScraperException as e:
    print(f'ScraperException: {e}')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fbgs-1.0.0.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

fbgs-1.0.0-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page