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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTQ1MzEsIm5iZiI6MTczOTU5NDIzMSwicGF0aCI6Ii8yMzI1OTI1LzI5MjkwODUzNi0wNDRkOTNkMS1mMGQ3LTQyOWQtOTZmNi00NWNkMGIwMzFmZTUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMDQzNzExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NGVlZmMxNTljN2MxMDFiZGJlODA3MWM4NDMzMGEzMzI4ZDU1MTBjZDQ4NjM3ZDQ2NTdiYTBmN2EzODZjOGE2YyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.f7mCNYrkwJo-e4wbg_roeFXl7t33Bw1pp5a6tE2W-OY)