How TO SEND MESSAGE TO YOUR FRIEND ON WHATSAPP USING PYTHON
Firstly we need to install some libraries below :
1. selenium
2. webDriver_manager for chrome or geckodriver for tiretox.
If you already have the two libraries mention don’t bother. After installation of the two libraries above then we can start writing the code.
SOME OTHER REQUIREMENTS FOR THE TASK
Make a to-do list app in which the user can add daily tasks to be accomplished.
we will need the name ot the friend or group that we want to send the message to just like it was stored on our phone contact.
your phone to scan the whatsapp on the browser.
HOW WILL YOU SCAN WITH YOUR PHONE
It might be a little difficult to scan with your phone when you have a whatsapp web loaded on your browser if you had not been using your laptop to do whatsapp chat before so these are the step to take below.
>go to web.whatsapp.com on your browser(in this case you don’t need to go to this web site as your program as done that for you), you will see something like this below.
>Now go to your whatsapp on your phone. click on the three dots at the right top of your screen.
>click on WhatsApp VWeb’ and you will see something like ‘SCAN QR CODE’ trying to scan something
>Now set it to what you have on your laptop (like you want to camera) so that it scan your laptop
>Your laptop should display your whatsapp now.
SOME FUNCTIONS NEEDED
find_element_by_xpath):
A function provided by selenium module to find the element with css selector.
send_keys():
A function provided by selenium module also to write data or text into the box we use
webdriver.Chrome():
A function that will open new window of chrome
get()
A function we will used to open up the Facebook website
quit():
A function to close the browser when we are done.
sleep():
A tunction to delay the running ot the script for some seconds.
input() and str:
these are python function to prompt and convert to string respectively. you must have accustomed to these before.
NECESSARY MODULES TO BE IMPORT AND IMPORTANT DATA
webdriver trom selenium.
sleep from time .
ChromeDriverManager from webdriver_manager.chrome .
Options from selenium.webdriver.chrome.options
Keys from selenium.webdriver.common.keys Also you will need to provide your friend name and message.

