swaaz / InstaBot

Instagram bot built using Python and Selenium
37 stars 13 forks source link

TimeoutException(message, screen, stacktrace) #23

Closed cyborg2006 closed 4 years ago

cyborg2006 commented 4 years ago

When I run under Linux or MacOS below is the error I received. Account opened by driver pop-up opened for followers and below is the comment and code stop working. Any response?

Enter the choice : 1 Traceback (most recent call last): File "program.py", line 221, in main() File "program.py", line 207, in main bot.get_unfollowers() File "program.py", line 95, in get_unfollowers following = self._get_names() File "program.py", line 133, in _get_names self._make_driver_wait("/html/body/div[4]/div/div[2]") File "program.py", line 191, in _make_driver_wait wait.until(EC.element_to_be_clickable((By.XPATH, element_to_locate))) File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message:

swaaz commented 4 years ago

@cyborg2006 thanks for opening the issue. I will fix them soon

swaaz commented 4 years ago

@autumnlewjb can you please fix the bug because I am working on an important project?

autumnlewjb commented 4 years ago

@autumnlewjb can you please fix the bug because I am working on an important project?

I'll try my best. It's most probably caused by faulty XPATH, which is stopping the element from being located. TimeOut is due to the max waiting time set in the WebDriverWait constructor. When the element is not located within the max waiting time, TimeOut exception is thrown.

I'll try my best to fix it.

cyborg2006 commented 4 years ago

Thank you guys for your effort. I will try and let you know.

cyborg2006 commented 4 years ago

Please see attached screenshot when I tried option 4. Data collected from following pop-up, and tried to collect from followers as well, but after couple of minutes received attached error.

Screen Shot

cyborg2006 commented 4 years ago

I was download zip file from Github to my local disk. Now, clone the repository using git and edit program.py file as you corrected. Option 1, and 2 is working. When I tried option 4 (4. Unfollowers those who don't follow you back) attached is the error and screenshot. Screen Shot 2

autumnlewjb commented 4 years ago

Please see attached screenshot when I tried option 4. Data collected from following pop-up, and tried to collect from followers as well, but after couple of minutes received attached error.

I was download zip file from Github to my local disk. Now, clone the repository using git and edit program.py file as you corrected. Option 1, and 2 is working. When I tried option 4 (4. Unfollowers those who don't follow you back) attached is the error and screenshot.

Do check out the PR #24 as I have pushed a few more commits that hopefully, will resolve your issue. By the way, I am happy that most of the processes work for you. Please keep me update so that we could learn and improve together.

cyborg2006 commented 4 years ago

Unfortunately, option 4 starting good but not finalized accordingly :)) Screen Shot 3

cyborg2006 commented 4 years ago

Do you want to unfollow : aleksandradanilova1358

  1. Yes 2. No Enter the choice : 1 found Search for elexicc

Do you want to unfollow : elexicc

  1. Yes 2. No Enter the choice : 1 Traceback (most recent call last): File "/Users/Cyborg/Google Drive/1. Python Projects/46. InstaBot/InstaBot/program.py", line 236, in main() File "/Users/Cyborg/Google Drive/1. Python Projects/46. InstaBot/InstaBot/program.py", line 228, in main bot.cancel_unfollowers() File "/Users/Cyborg/Google Drive/1. Python Projects/46. InstaBot/InstaBot/program.py", line 187, in cancel_unfollowers self.driver.find_element_by_xpath("/html/body/div[1]/section/main/div/header/section/div[1]/div[2]/div/span/span[1]/button").click() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 80, in click self._execute(Command.CLICK_ELEMENT) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 633, in _execute return self._parent.execute(command, params) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (686, 14). Other element would receive the click:
    ...
    (Session info: chrome=84.0.4147.105)
autumnlewjb commented 4 years ago

Unfortunately, option 4 starting good but not finalized accordingly :))

I was surprised to the sense that I did not encounter this error, so I can't see the error in action. Could you provide me more insights on the error?

Was the webpage loading or refreshing before the exception is thrown?

cyborg2006 commented 4 years ago

Yes webpage is normally loading. "Following" pop-up is opened and bot started to work. When bot grab all the information from "following", bot opened the "followers" pop-up. In addition scroll-down process started by bot, but couple of seconds later program halt and show the comment.