A Python library for scraping Trustpilot reviews.
Project description
trustpilot-scraper is a Python package designed for scraping Trustpilot reviews. It provides functions to retrieve Trustpilot reviews from a given Trustpilot page URL.
Installation
You can install trustpilot-scraper via pip:
pip install trustpilot-scraper
Usage
To use trustpilot-scraper, import the scrape_trustpilot_reviews function from the trustpilot_scraper.scraper module. Then, provide the base URL of the Trustpilot page from which you want to scrape reviews.
from trustpilot_scraper.scraper import scrape_trustpilot_reviews
base_url = 'https://www.trustpilot.com/review/example.com'
reviews = scrape_trustpilot_reviews(base_url)
for review in reviews:
print(review)
Output
The scrape_trustpilot_reviews function returns a list of dictionaries, where each dictionary represents a single Trustpilot review. Each review dictionary contains the following keys: ‘Date’, ‘Author’, ‘Body’, ‘Heading’, ‘Rating’, and ‘Location’.
Features
Scrapes Trustpilot reviews from the provided base URL.
Retrieves review data including date, author, body, heading, rating, and location.
Handles pagination automatically to scrape all available reviews.
Dependencies
requests: For making HTTP requests.
beautifulsoup4: For parsing HTML content.
pandas: For data manipulation.
For more information and documentation, please visit the GitHub repository: https://github.com/irfanalidv/trustpilot_scraper.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file trustpilot_scraper-0.10-py3-none-any.whl
.
File metadata
- Download URL: trustpilot_scraper-0.10-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f916303b99a675e250d4fbfc1cfa704c2c0b51dc3a5d7f3ef35ce5581c9ad168 |
|
MD5 | 8d5f88819d4776f328c5628792e16aa7 |
|
BLAKE2b-256 | 01cf5e203da30fb9ae6de81ff03c34190d208e4a778e4cb027b253598a9c7531 |