cyber-hoax / automatewhatsapp

automate whatsapp
9 stars 7 forks source link

Unable to locate element #4

Open saurabh0719 opened 3 years ago

saurabh0719 commented 3 years ago

Hi,

I was trying to use your project but I ran into some errors. It is not able to locate the user with the title attribute of the span tag. I'm new to selenium so, any idea why this is happening?

Below is a snippet from the terminal output


Traceback (most recent call last):
  File "whatsapp.py", line 19, in <module>
    user = driver.find_element_by_xpath('//span[@title = "{}"]'.format(name))
  File "D:\somepythonscripts\selenium\dev-env\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "D:\somepythonscripts\selenium\dev-env\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
    return self.execute(Command.FIND_ELEMENT, {
  File "D:\somepythonscripts\selenium\dev-env\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "D:\somepythonscripts\selenium\dev-env\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//span[@title = "SomeName"]"}      
  (Session info: chrome=91.0.4472.114)
abinroy04 commented 3 years ago

Hey I have the same issue.

harikiran-01 commented 3 years ago

Same issue