nikilkumar9 / InstaBot

A collection of Python scripts that automates the Firefox browser to log on to a Instagram account (account username and password specified by user in each script) to like/follow/unfollow user photos, accounts and more (script specific information and instructions follow). Users can use InstaBot passively and will be notified of completion/status of tasks through an automatic Gmail email.
7 stars 2 forks source link

Unable to locate element using hashtag based script #3

Closed felixfong227 closed 5 years ago

felixfong227 commented 5 years ago

Python versoin: Python 3.5.2 Command: python3 hashtagBased_follow.py

image

Text version of the stderr

Traceback (most recent call last):
  File "hashtagBased_follow.py", line 174, in <module>
    ig.login()
  File "hashtagBased_follow.py", line 43, in login
    login_button = driver.find_element_by_xpath("//a[@href='/accounts/login/?source=auth_switcher']")
  File "/home/ubuntu/.local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 394, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 978, in find_element
    'value': value})['value']
  File "/home/ubuntu/.local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: //a[@href='/accounts/login/?source=auth_switcher']
nikilkumar9 commented 5 years ago

Hi Felix, on certain occasions (quite rarely), the bot doesn't locate certain components.

However, the program is working on my desktop, can you run the program again? Comment back if the problem persists.

felixfong227 commented 5 years ago

Ok 朋友🙃 Get back to you in an hour.

For your information, the machine executing the script was an cloud hosted Ubuntu 18.04