Description
Welcome to the Ali2Woo Reviews Scraper. This tool,
aw-scraper.py
, allows you to scrape product reviews from AliExpress and associate them with products on your WooCommerce store. By using this scraper, you can enrich your WooCommerce product pages with genuine customer reviews from AliExpress, enhancing the credibility and attractiveness of your products.
Features
- Scrapes reviews from AliExpress for specified product IDs.
- Associates scraped reviews with corresponding WooCommerce product IDs.
- Supports headless browsing using Selenium with the Gecko driver.
- Extracts review content, rating, date, user display name, and media links.
- Saves scraped reviews into CSV files for easy import into WooCommerce.
Prerequisites
Before running the scraper, ensure you have the following installed:
- Python:
- Install Python from the official website.
- We recommend using the Spyder IDE for an enhanced development experience. Download Spyder from the official website.
- Firefox Browser:
- Download and install Firefox from the official website.
- GeckoDriver:
- Download the appropriate version of GeckoDriver for your operating system from the GeckoDriver releases page.
- Ensure the GeckoDriver executable is placed in the
directory relative to the script or update the path in the script accordingly.driver/firefox/
- Selenium (latest version):
- Install Selenium using pip:
pip install selenium
- Install Selenium using pip:
- BeautifulSoup (latest version):
- Install BeautifulSoup using pip:
pip install beautifulsoup4
- Install BeautifulSoup using pip:
- Product List CSV:
- Prepare a CSV file named
with the following columns:product_list.csv
-
: The AliExpress product ID.ali_Id
-
: The corresponding WooCommerce product ID.woo_Id
-
- Prepare a CSV file named
Usage
To run the scraper, execute the following command in your terminal:
python3 aw-scraper.py
The script will read the
file, scrape the reviews for each AliExpress product ID, and save the reviews in a CSV file named in the format
product_list.csv
auto-scraped/{woo_Id}_reviews.csv
. If no reviews are found for a product, an empty CSV file named
will be created.auto-scraped/{woo_Id}_reviews_skipped.csv
How It Works
- Reading Product List: The script reads the
file to get the list of AliExpress and WooCommerce product IDs.product_list.csv
- Scraping Reviews: For each product, it navigates to the AliExpress reviews page using Selenium in headless mode, scrapes the reviews, and extracts relevant data using BeautifulSoup.
- Saving Reviews: The extracted reviews are saved into CSV files, which can be easily imported into WooCommerce.
Example Output
After running the script, you will find the following files in the
directory:auto-scraped/
- For products with reviews:
{woo_Id}_reviews.csv
- For products without reviews:
{woo_Id}_reviews_skipped.csv
Each review CSV file will contain the following columns:
-
: The text of the review.review_content
-
: The rating given by the user (1-5 stars).review_score
-
: The date of the review.date
-
: The WooCommerce product ID.product_id
-
: The display name of the reviewer.display_name
-
: A placeholder email address for the reviewer.email
-
: Currently set toorder_id
None
. -
: Links to any media (images) included in the review.media
Support
If you encounter any issues or have questions, please use our contact us page
Reviews
There are no reviews yet.