lazargugleta / instagramUnfollowers

Find out who is not following you back on Instagram.
27 stars 10 forks source link

Exception has occurred: NoSuchElementException #7

Closed akbowen closed 2 years ago

akbowen commented 2 years ago

Hi,

I'm not familiar with Python so I'm not sure how to debug this issue. Please excuse my ignorance.

When I run the program from followers.py, everything is fine up until right after the Chrome window opens and instagram.com is loaded. Once I get there, the window closes and the program stops.

I see this in the terminal:

Initializing WebDriver Manager
--------------------------------

====== WebDriver manager ======
Current google-chrome version is 97.0.4692
Get LATEST chromedriver version for 97.0.4692 google-chrome
Driver [/Users/akbowen/.wdm/drivers/chromedriver/mac64/97.0.4692.71/chromedriver] found in cache
/Users/akbowen/Downloads/instagramUnfollowers-master/followers.py:10: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
  self.driver = webdriver.Chrome(ChromeDriverManager().install())
--------------------------------
WebDriver Manager successfully initialized.
Traceback (most recent call last):
  File "/Users/akbowen/Downloads/instagramUnfollowers-master/followers.py", line 122, in <module>
    my_bot = InstaUnfollowers(username, password)
  File "/Users/akbowen/Downloads/instagramUnfollowers-master/followers.py", line 17, in __init__
    accept_all_btn = self.driver.find_element(By.CLASS_NAME, 'bIiDR')
  File "/Users/akbowen/Downloads/instagramUnfollowers-master/env/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 1244, in find_element
    return self.execute(Command.FIND_ELEMENT, {
  File "/Users/akbowen/Downloads/instagramUnfollowers-master/env/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 424, in execute
    self.error_handler.check_response(response)
  File "/Users/akbowen/Downloads/instagramUnfollowers-master/env/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".bIiDR"}
  (Session info: chrome=97.0.4692.99)
Stacktrace:
0   chromedriver                        0x0000000105443e69 chromedriver + 5160553
1   chromedriver                        0x00000001053ce593 chromedriver + 4679059
2   chromedriver                        0x0000000104f822c8 chromedriver + 172744
3   chromedriver                        0x0000000104fb7b62 chromedriver + 392034
4   chromedriver                        0x0000000104fb7d21 chromedriver + 392481
5   chromedriver                        0x0000000104fea304 chromedriver + 598788
6   chromedriver                        0x0000000104fd53fd chromedriver + 513021
7   chromedriver                        0x0000000104fe80ab chromedriver + 589995
8   chromedriver                        0x0000000104fd5623 chromedriver + 513571
9   chromedriver                        0x0000000104faadce chromedriver + 339406
10  chromedriver                        0x0000000104fac105 chromedriver + 344325
11  chromedriver                        0x00000001053ff23e chromedriver + 4878910
12  chromedriver                        0x0000000105416d17 chromedriver + 4975895
13  chromedriver                        0x000000010541ca3f chromedriver + 4999743
14  chromedriver                        0x000000010541761a chromedriver + 4978202
15  chromedriver                        0x00000001053f3bb1 chromedriver + 4832177
16  chromedriver                        0x0000000105433fd8 chromedriver + 5095384
17  chromedriver                        0x0000000105434161 chromedriver + 5095777
18  chromedriver                        0x000000010544b2a8 chromedriver + 5190312
19  libsystem_pthread.dylib             0x00007ff8059ed4f4 _pthread_start + 125
20  libsystem_pthread.dylib             0x00007ff8059e900f thread_start + 15

I hope this is helpful in solving the issue.

lazargugleta commented 2 years ago

Hey I will close this one since I updated it now and it works smoothly!

akbowen commented 2 years ago

Hi,

I'm still getting this when I attempt to run the script:

Initializing WebDriver Manager
--------------------------------
--------------------------------
WebDriver Manager successfully initialized.
Traceback (most recent call last):
  File "/Users/akbowen/Downloads/instagramUnfollowers/followers.py", line 123, in <module>
    my_bot = InstaUnfollowers(username, password)
  File "/Users/akbowen/Downloads/instagramUnfollowers/followers.py", line 18, in __init__
    accept_all_btn = self.driver.find_element(By.CLASS_NAME, 'bIiDR')
  File "/Users/akbowen/Downloads/instagramUnfollowers/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 856, in find_element
    return self.execute(Command.FIND_ELEMENT, {
  File "/Users/akbowen/Downloads/instagramUnfollowers/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
    self.error_handler.check_response(response)
  File "/Users/akbowen/Downloads/instagramUnfollowers/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 243, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".bIiDR"}
  (Session info: chrome=107.0.5304.87)
Stacktrace:
0   chromedriver                        0x0000000102c42a88 chromedriver + 4123272
1   chromedriver                        0x0000000102bce778 chromedriver + 3647352
2   chromedriver                        0x0000000102890ac4 chromedriver + 248516
3   chromedriver                        0x00000001028c6f68 chromedriver + 470888
4   chromedriver                        0x00000001028f9020 chromedriver + 675872
5   chromedriver                        0x00000001028bab10 chromedriver + 420624
6   chromedriver                        0x00000001028bbc30 chromedriver + 425008
7   chromedriver                        0x0000000102c14ae4 chromedriver + 3934948
8   chromedriver                        0x0000000102c17f24 chromedriver + 3948324
9   chromedriver                        0x0000000102c18508 chromedriver + 3949832
10  chromedriver                        0x0000000102c1eb30 chromedriver + 3975984
11  chromedriver                        0x0000000102c18b24 chromedriver + 3951396
12  chromedriver                        0x0000000102bf371c chromedriver + 3798812
13  chromedriver                        0x0000000102c352f0 chromedriver + 4068080
14  chromedriver                        0x0000000102c35444 chromedriver + 4068420
15  chromedriver                        0x0000000102c49450 chromedriver + 4150352
16  libsystem_pthread.dylib             0x000000018e6b606c _pthread_start + 148
17  libsystem_pthread.dylib             0x000000018e6b0e2c thread_start + 8