A python script to scrape all current FDA approved drugs from fda.gov.
This script was created to scrape a list of all current FDA approved drugs in order to create a custom Alexa skill slot type that validates drug names.
The scraper uses the request module to make an HTTP request to retrieve the webpage. The beautiful soup module then turns the HTML content into an object that can return certain HTML elements based on filtering arguments. This is used to get all the drug names from each alphabetical webpage (there is a webpage for drugs starting with 'A', 'B', and so on). These drug names are appended to fda_drug_list.txt which serves as the final output of the web-scraper.
This project uses pipenv for dependency management. You can install pipenv for your user account using pip install --user pipenv.
After pipenv is installed:
- Run
pipenv installin the script's directory to install dependencies - Run the code using the command
pipenv run python3 main.py