This script searches for businesses in your specified area that don't have websites and exports them to a CSV file.
- Python 3.7 or higher
- A Google Cloud Platform account with Places API enabled
- A Google Maps API key
- Install the required dependencies:
pip install -r requirements.txt- Create a
.envfile in the project root and add your configuration:
GOOGLE_MAPS_API_KEY=your_api_key_here
LOCATION_COORDS=latitude,longitude (in a comma-delimited list / a tuple)
Run the script:
python business_scraper.pyThe script will:
- Prompt you to enter your location (Format: County, State abbreviation)
- Search for businesses in your specified area
- Filter out businesses that have websites
- Export the remaining businesses to
your_specified_county_businesses_no_website.csv
The CSV file will contain the following columns:
- name: Business name
- address: Business address
- phone: Business phone number (if available)
- Searches within a 20-mile radius of the specified coordinates
- Filters out:
- Medical facilities
- Religious institutions
- Educational institutions
- Government offices
- Non-profit organizations
- Interactive location input
- Configurable search radius
- Configurable maximum number of results
- The script uses a 20-mile radius from the coordinates specified in the .env file
- The Places API has usage limits and costs associated with it
- Make sure your API key has the Places API enabled
- The .env file should contain both your API key and location coordinates