A professional-grade Python tool designed to scrape customer reviews (date, rating, title, and body) from any company profile on Trustpilot.
It leverages undetected_chromedriver to bypass anti-bot protections and supports secure email-based authentication.
- Anti-Bot Bypass: Uses
undetected_chromedriverto reduce detection risk - Authentication Support: Login via email with OTP verification directly in the terminal
- Headless Mode: Run the scraper in the background without opening a browser window
- Clean Data Export: Outputs structured
.csvfiles (UTF-8-SIG, Excel-compatible) - Secure Configuration: Sensitive data stored safely using
.envfiles
Before getting started, make sure you have:
- A valid Trustpilot account
- Python 3.8+ installed
- Google Chrome installed on your system
git clone https://github.com/AndreaBilliar/trustpilot-scraper.git
cd trustpilot-scraperWindows
python -m venv venv
venv\Scripts\activateLinux / macOS
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCopy the template:
Windows
copy .env.example .envLinux / macOS
cp .env.example .env# Target company Trustpilot page
TARGET_URL=https://www.trustpilot.com/review/example.com
# Your Trustpilot login email
USER_EMAIL=your_email@example.com
# Scraping range
START_PAGE=1
END_PAGE=5
# Browser mode
# True = headless (no browser UI)
# False = visible browser (recommended for debugging)
HEADLESS=False
# Optional: Force Chrome version (only if mismatch error occurs)
# Example: CHROME_VERSION=146
# CHROME_VERSION=- Never share your
.envfile publicly - Ensure
.envis listed in your.gitignore - Adjust page range based on your scraping needs
- Use
HEADLESS=Falseif you face login or detection issues
Run the scraper:
python trustpilot_scraper.py- Chrome will open automatically
- Your email will be entered
- Check your inbox for the OTP code
- Enter the code in the terminal
- The bot navigates through pages automatically
- Extracts reviews (date, rating, title, body)
- Saves results into a
.csvfile in the project folder
Error: SessionNotCreatedException
Fix:
- Check your Chrome version (Settings → About Chrome)
- Set the version in your
.env:
CHROME_VERSION=146Error: getaddrinfo failed / [Errno 11001]
Fix:
- Check your internet connection
- Disable VPN or firewall if blocking Python
This tool is for educational purposes only. Web scraping may violate Trustpilot's Terms of Service.
Use responsibly:
- Respect robots.txt
- Avoid aggressive scraping
- Follow applicable laws and platform rules
The author is not responsible for misuse.
This project is licensed under the MIT License.