Open sagban opened 6 years ago
Hi @sagban, Please check the send button xpath and click it.
@ManivannanMurugavel how to modify the send button so it will automatically send it?
Hi, i have updated the code for sending the message to specific contact.
Change the line 34 to
sendbutton = driver.find_elements_by_xpath('//*[@id="main"]/footer/div[1]/div[3]/button')[0]
Nice work bro,
I want to suggest one thing, the current program works on recent contacts only. I made one python list of my friends for sending messages to the multiple people. But there is error arises because as first message sent by program the order of the recents changes and program generates a error
raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: Element <span dir="auto" title="..." class="_1wjpf">Priyank</span> is not clickable at point (103, 230). Other element would receive the click: <span dir="ltr" class="_1wjpf _3NFp9">...</span>
Instead of searching friends name in the recents list, we can search a name in the contact list and can send the message. I really want to implement this because it can be very helpful in publicity as it'll be very efficient as compare to sent emails. What you think?
Hi @sagban I have uploaded the python script for searching friend contact and send message. Please check it.
@ManivannanMurugavel Can you do it in Firefox instead of Chrome? Thanks
hi @DanielUnn
It's worked both.....
message.send_keys('"This is Testing Message from Selenium"')
File "C:\Users\shashi chandra\Anaconda3\lib\site-packages\selenium\webdriver\remote\webelement.py", line 479, in send_keys 'value': keys_to_typing(value)}) File "C:\Users\shashi chandra\Anaconda3\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute return self._parent.execute(command, params) File "C:\Users\shashi chandra\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\shashi chandra\Anaconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: call function result missing 'value' (Session info: chrome=79.0.3938.0) (Driver info: chromedriver=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed),platform=Windows NT 10.0.18362 x86_64)
Hi, When I am running this program, it's not sending a whatsapp message, it directs my friends inbox, and message gets typed there, but not sending. May be this because of sendbutton.click() is not working.
On my terminal It's showing this
Traceback (most recent call last): File "whatsapp_sendmessage.py", line 34, in <module> sendbutton = driver.find_elements_by_xpath('//*[@id="main"]/footer/div[1]/button')[0] IndexError: list index out of range