This Python script is designed to notify a WhatsApp user or group about new web leads from the DealerNet system for automotive dealerships in Brazil. DealerNet doesn't have a built-in notification system, so this script serves as a workaround to keep users informed about new leads.
- Clone this repository:
git clone https://github.com/guinacio/dealernetLeadNotifier.git
cd dealernetLeadNotifier
- Create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # On Windows, use 'venv\Scripts\activate'
- Install dependencies:
pip install -r requirements.txt
playwright install
- Create a
credentials.env
file with your DealerNet and WhatsApp API credentials:
USERNAME_CR=<Your_DealerNet_Username>
PASSWORD_CR=<Your_DealerNet_Password>
API_KEY=<Your_WhatsApp_API_Key>
Replace <Your_DealerNet_Username>
, <Your_DealerNet_Password>
, and <Your_WhatsApp_API_Key>
with your actual credentials. Or you can edit the example .env file manually.
- Adjust constants in the script such as
WAIT_TIME
,LOGIN_URL
,DEALERNET_USERNAME
,DEALERSHIP
, andurl
according to your setup.
Run the script:
python lead_notifier.py
The script will run continuously, checking for new leads at the specified intervals.
- The script logs errors in the
playwright_errors.log
file. - Adjust the
NOTIFY_ERROR
variable to control error notifications.
![](https://private-user-images.githubusercontent.com/2325925/292908536-044d93d1-f0d7-429d-96f6-45cd0b031fe5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5Mzc1OTAsIm5iZiI6MTcyNTkzNzI5MCwicGF0aCI6Ii8yMzI1OTI1LzI5MjkwODUzNi0wNDRkOTNkMS1mMGQ3LTQyOWQtOTZmNi00NWNkMGIwMzFmZTUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MTBUMDMwMTMwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDhkZTViZDU1MzE1MzNmMmM0N2M2ODBiMmI2MWM1NmRkMjQ1NTlmYzM2OTY0YWE3NTc0M2Q5ZjdkNzNmMzI0MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Hepgu9E1THNcrMAWnMq34yUwaDisV0-vDfoqaO85st8)