Skip to main content

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

trustpilot_scraper-0.10-py3-none-any.whl (2.8 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