Skip to main content

A module designed to automate the extraction of follower counts and post details from a public Facebook page.

Project description

Licence Python Wheel Latest Releases Stars Forks Issues PRs Last commit Downloads Workflow PyPI Maintained OS Documentation Status

MetaDataScraper

MetaDataScraper is a Python package designed to automate the extraction of information like follower counts, and post details & interactions from a public Facebook page, in the form of a list. It uses Selenium WebDriver for web automation and scraping.
The module provides two classes: LoginlessScraper and LoggedInScraper. The LoginlessScraper class does not require any authentication or API keys to scrape the data. However, it has a drawback of being unable to access some Facebook pages. The LoggedInScraper class overcomes this drawback by utilising the credentials of a Facebook account (of user) to login and scrape the data.

Installation

You can install MetaDataScraper using pip:

pip install MetaDataScraper

Make sure you have Python 3.x and pip installed.

Usage

To use MetaDataScraper, follow these steps:

  1. Import the LoginlessScraper or the LoggedInScraper class:

    from MetaDataScraper import LoginlessScraper, LoggedInScraper
    
  2. Initialize the scraper with the Facebook page ID:

    page_id = "your_target_page_id"
    scraper = LoginlessScraper(page_id)
    email = "your_facebook_email"
    password = "your_facebook_password"
    scraper = LoggedInScraper(page_id, email, password)
    
  3. Scrape the Facebook page to retrieve information:

    result = scraper.scrape()
    
  4. Access the scraped data from the result dictionary:

    print(f"Followers: {result['followers']}")
    print(f"Post Texts: {result['post_texts']}")
    print(f"Post Likes: {result['post_likes']}")
    print(f"Post Shares: {result['post_shares']}")
    print(f"Is Video: {result['is_video']}")
    print(f"Video Links: {result['video_links']}")
    

Features

  • Automated Extraction: Automatically fetches follower counts, post texts, likes, shares, and video links from Facebook pages.
  • Comprehensive Data Retrieval: Retrieves detailed information about each post, including text content, interaction metrics (likes, shares), and multimedia (e.g., video links).
  • Flexible Handling: Adapts to diverse post structures and various types of multimedia content present on Facebook pages, like post texts or reels.
  • Enhanced Access with Logged-In Scraper: Overcomes limitations faced by anonymous scraping (loginless) by utilizing Facebook account credentials for broader page access.
  • Headless Operation: Executes scraping tasks in headless mode, ensuring seamless and non-intrusive data collection without displaying a browser interface.
  • Scalability: Supports scaling to handle large volumes of data extraction efficiently, suitable for monitoring multiple Facebook pages simultaneously.
  • Dependency Management: Utilizes Selenium WebDriver for robust web automation and scraping capabilities, compatible with Python 3.x environments.
  • Ease of Use: Simplifies the process with straightforward initialization and method calls, facilitating quick integration into existing workflows.

Dependencies

  • selenium
  • webdriver_manager

License

This project is licensed under the Apache Software License Version 2.0 - see the LICENSE file for details.

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

metadatascraper-1.0.2.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

MetaDataScraper-1.0.2-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file metadatascraper-1.0.2.tar.gz.

File metadata

  • Download URL: metadatascraper-1.0.2.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for metadatascraper-1.0.2.tar.gz
Algorithm Hash digest
SHA256 17c164e7a6d5dc0c794927910ac21c6e16567880bff37187e63253f7734e7e36
MD5 43e701b7301d79cd9a094f1892a36392
BLAKE2b-256 7bd1be27312a13031a40309b91e84ca53ccfc26ccba54460b68688eedd2d3ba1

See more details on using hashes here.

File details

Details for the file MetaDataScraper-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for MetaDataScraper-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cd9ae74e954fe8ebe89fe2a90d4aa2b20e7a5fce2abd35b168d8c89c14db5b80
MD5 f8b7774540d186f8f1289980c0102dfd
BLAKE2b-256 f6112fae79e36c75eed08d5b70b26b8b8bebcd95a51b0dfa4f1203ff88f80c13

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