This Python script, along with a batch file, automates the process of exporting WooCommerce products from a WordPress website using Selenium and the Chrome browser.
Prerequisites • Installation • Usage • Acknowledgment • Diagrams •
- Python 3.7.1
- Selenium 1.22
- ChromeDriver 2.24.1
- Google Chrome
- Clone or download the repository.
- Install the required Python packages by running
pip install -r requirements.txt
. - Download the appropriate version of ChromeDriver for your Chrome browser and operating system from the official website: https://sites.google.com/a/chromium.org/chromedriver/downloads
- Extract the ChromeDriver executable and place it in a directory that is included in your system's
PATH
environment variable.
- Open the
export-woocommerce-products-wordpress.py
file and update the following lines with your WordPress website credentials and admin URL:
driver.get('https://yourwordpresssite.com/wp-admin')
id_box.send_keys('your-user-name')
pass_box.send_keys('your-password')
- Save the changes to the Python file.
- Double-click the Run.bat file or run it from the command prompt to execute the script.
The script will open the Chrome browser, navigate to your WordPress admin dashboard, log in using the provided credentials, navigate to the WooCommerce products page, and initiate the export process. The exported CSV file will be downloaded to your default downloads folder.
Selenium - The web automation tool used in this project. ChromeDriver - The WebDriver used to automate the Chrome browser.