Skip to content
Advertisement

Unable to send WhatsApp message using chrome driver Python Error: NoSuchElementException

This is my first post here! I am using Selenium’s Chrome Driver to send WhatsApp attachment to some people. Here is my code:

JavaScript

ERROR:

JavaScript

It says it is unable to locate the element but I have bene very careful in inspecting the website and then writing the code. Still I wonder why it does not work. Can anyone please help me with what is it that I am doing wrnong? Thank You!

Advertisement

Answer

Looks like you are missing a wait / delay before clicking that element.
The simplest solution is to put

JavaScript

before

JavaScript

However, it’s much better to use expected conditions there. Like this:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement