ManivannanMurugavel / whatsappmessagepython

20 stars 12 forks source link

Not Sending whatsapp message #1

Open sagban opened 6 years ago

sagban commented 6 years ago

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

ManivannanMurugavel commented 6 years ago

Hi @sagban, Please check the send button xpath and click it.

DanielUnn commented 6 years ago

@ManivannanMurugavel how to modify the send button so it will automatically send it?

ManivannanMurugavel commented 6 years ago

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]

sagban commented 6 years ago

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?

ManivannanMurugavel commented 6 years ago

Hi @sagban I have uploaded the python script for searching friend contact and send message. Please check it.

DanielUnn commented 6 years ago

@ManivannanMurugavel Can you do it in Firefox instead of Chrome? Thanks

ManivannanMurugavel commented 6 years ago

hi @DanielUnn

It's worked both.....

Ninjacodeliketaka commented 5 years ago
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)