This web scrape utilizes the BeautifulSoup and Selenium Webdriver libraries to fetch the following data from an Anthem Health Provider directory and load it into a CSV file:
- Name
- Address
- Phone #
This script ONLY works for the Blue Anthem website. It will break for any other website.
These instructions will get you a copy of the project up and running on your local machine for testing purposes.
-
Once Python 3.7 is installed:
-
Webdriver. Please install the Chrome version!
-
Selenium:
C:\Python37\Scripts\pip install selenium
-
BeautifulSoup:
C:\Python37\Scripts\pip install beautifulsoup4
-
-
In the DriverPath.txt file, paste the path of the webdriver you installed above
Example:
C:/Users/johndoe/Downloads/chromedriver
-
If you installed a driver other than Chrome, open Scrape.py and do the following:
On line 27, by default there is
driver = webdriver.Chrome(path_to_driver)
- For Firefox:
driver = webdriver.Firefox(path_to_driver)
- For Safari:
driver = webdriver.Safari(path_to_driver)
- For Firefox:
-
On the command line, go into the directory of this github repository and run:
python3 scrape.py
-
Wait for the scrape to finish, and then open the OutputData.csv file and voila, all the health provider data is loaded!
-
Congratulations!
- CHUDDY