This script automates scraping price, total ratings, and monthly ratings from Lazada product pages across multiple countries.
- Automated Data Extraction – Uses Playwright to navigate Lazada product pages and extract key details.
- Multi-Country Support – Works across different Lazada country domains.
- Total & Monthly Ratings – Captures both total reviews and last month's reviews.
- Dynamic Price Extraction – Extracts and formats the latest product price from Lazada.
- Google Sheets Integration – Automatically stores scraped data into a Google Sheets document.
- Python 3.9+
- Playwright
- gspread-pandas
- pandas, numpy
pip install pytest-playwrightplaywright install cd %USERPROFILE%\AppData\Local\ms-playwright\chromium-1129\chrome-win %USERPROFILE%\AppData\Local\ms-playwright\chromium-1129\chrome-win> .\chrome --remote-debugging-port=9222Open the following URL in your Chromium browser:
http://localhost:9222/json/versionCopy the value of webSocketDebuggerUrl and paste it into the web_socket_path variable in the script.
- Create a Google Service Account.
- Save the JSON credentials in the following directory:
%USERPROFILE%\AppData\Roaming\gspread_pandas\google_secret.json
- Follow this Google Sheets Template for formatting.
- Share access to your service account in this spreadsheet.
- Input all necessary settings and parameters before execution.
- Once everything is set up, execute the script, and Playwright will handle the rest!