This Python script uses Selenium to scrape population data by country from the Worldometer website and stores it in an Excel file.
-
Install the required dependencies by running
pip install -r requirements.txt
. -
Make sure you have Google Chrome installed and download the appropriate ChromeDriver executable for your system from https://chromedriver.chromium.org/downloads.
-
Edit the
webdriver_path
variable in the script to point to the location of the downloaded ChromeDriver executable. -
Run the script. It will open a Chrome browser, scrape the data, and save it to an Excel file.
-
The scraped data will be saved in a file named
population_data.xlsx
in the same directory as the script.
- Python 3.x
- Chrome browser
- ChromeDriver executable (downloaded and specified in the script)
- Selenium
- pandas
python population_scraper.py