Skip to main content

Scrape Facebook public pages using the web API.

Project description

Facebook Scraper

Scrape Facebook public pages using the web API. Inspired by twitter-scraper.

Usage

>>> from facebook_scraper import get_posts

>>> for post in get_posts('nintendo', pages=1):
...     print(post['text'][:50])
...
The final step on the road to the Super Smash Bros
Were headed to PAX East 3/28-3/31 with new games

Post example

{'post_id': '2257188721032235',
 'text': 'Don’t let this diminutive version of the Hero of Time fool you, '
         'Young Link is just as heroic as his fully grown version! Young Link '
         'joins the Super Smash Bros. series of amiibo figures!',
 'time': datetime.datetime(2019, 4, 29, 12, 0, 1),
 'image': 'https://scontent.flim16-1.fna.fbcdn.net'
          '/v/t1.0-0/cp0/e15/q65/p320x320'
          '/58680860_2257182054366235_1985558733786185728_n.jpg'
          '?_nc_cat=1&_nc_ht=scontent.flim16-1.fna'
          '&oh=31b0ba32ec7886e95a5478c479ba1d38&oe=5D6CDEE4',
 'likes': 2036,
 'comments': 214,
 'shares': 0,
 'post_url': 'https://m.facebook.com/story.php'
             '?story_fbid=2257188721032235&id=119240841493711'}

Notes

  • There is no guarantee that every field will be extracted (they might be None).
  • Shares doesn't seem to work at the moment.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

facebook-scraper-0.1.2.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

facebook_scraper-0.1.2-py2.py3-none-any.whl (4.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file facebook-scraper-0.1.2.tar.gz.

File metadata

  • Download URL: facebook-scraper-0.1.2.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for facebook-scraper-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5d69817e96e18d329300ea2b812db4d7dc7108ed5b403495f9b910b41f77f4dc
MD5 1efaeca702840e71661602ff5296d4af
BLAKE2b-256 8a182bddfec9eaf64f86d3c89d06a0c7aeead17757b638a6334d82a6a0509d20

See more details on using hashes here.

File details

Details for the file facebook_scraper-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: facebook_scraper-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for facebook_scraper-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0ecf65c76938cb7e6b7739ed9af28599b02b897910042857f29546cc8fa8d0c0
MD5 2beb257ea9b29898d84f3d304a0b67bf
BLAKE2b-256 b5d638392e3753745b1fee93def910a0e64114e55205f4ce26db925fad33abb3

See more details on using hashes here.

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