Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Sending whatsapp message #1

Open
sagban opened this issue Aug 4, 2018 · 8 comments
Open

Not Sending whatsapp message #1

sagban opened this issue Aug 4, 2018 · 8 comments

Comments

@sagban
Copy link

sagban commented Aug 4, 2018

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
Copy link
Owner

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

@DanielUnn
Copy link

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

@ManivannanMurugavel
Copy link
Owner

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
Copy link
Author

sagban commented Aug 24, 2018

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
Copy link
Owner

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

@DanielUnn
Copy link

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

@ManivannanMurugavel
Copy link
Owner

hi @DanielUnn

It's worked both.....

@Ninjacodeliketaka
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants