Skip to content

unable to locate element xpath #13

Description

@arda1984

I get this error when I try to run Instagrambot:

"D:\Programme\JetBrains\PyCharm Community Edition 2021.2.1\env\Scripts\python.exe" C:/Users/ebrul/Desktop/InstagramBot/instagramBot.py
Traceback (most recent call last):
  File "C:/Users/ebrul/Desktop/InstagramBot/instagramBot.py", line 89, in <module>
    start()
  File "C:/Users/ebrul/Desktop/InstagramBot/instagramBot.py", line 66, in start
    acceptCookies = browser.find_element_by_xpath('/html/body/div[2]/div/div/div/div[2]/button[1]');
  File "D:\Programme\JetBrains\PyCharm Community Edition 2021.2.1\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:\Programme\JetBrains\PyCharm Community Edition 2021.2.1\env\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
    return self.execute(Command.FIND_ELEMENT, {
  File "D:\Programme\JetBrains\PyCharm Community Edition 2021.2.1\env\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "D:\Programme\JetBrains\PyCharm Community Edition 2021.2.1\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":"/html/body/div[2]/div/div/div/div[2]/button[1]"}
  (Session info: chrome=95.0.4638.54)


Process finished with exit code 1

It just opens https://www.instagram.com/accounts/login/?source=auth_switcher with chrome and that's it.
the only thing I've changed is the comments, webdriver dir, and my account info. How can I fix this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions