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:
-
Import the
LoginlessScraperor theLoggedInScraperclass:from MetaDataScraper import LoginlessScraper, LoggedInScraper
-
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)
-
Scrape the Facebook page to retrieve information:
result = scraper.scrape()
-
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.
Metadata
Release files for MetaDataScraper 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| metadatascraper-1.0.4.tar.gz | 13.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| MetaDataScraper-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.9 kB
Release files / metadatascraper-1.0.4.tar.gz
| Download URL | metadatascraper-1.0.4.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
731e6b94d85a32c3db76f8e4f4356b95429e027378230a59f07d3e97ca9d3bd2
|
|
BLAKE2b-256 checksum How to use checksums |
a00c3e9706544734db509f31a8b33b0640ed8b421c123934eab50e78b7041622
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|
Release files / MetaDataScraper-1.0.4-py3-none-any.whl
| Download URL | MetaDataScraper-1.0.4-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
66e968f19b6d3e7e1127ffda11241d88c2a18bec860fcb165f99e797eb09b880
|
|
BLAKE2b-256 checksum How to use checksums |
0b54383b83694bfb524ee64be197c73ba5de96b7801730694b7b409d55da463d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|