Prem-ium/BingRewards

Mobile Searches unable to find element

Kuronekoji opened this issue · 1 comments

Have had this running using python and pm2 so it can run in the background 24/7 for about 2 days now and was wondering if it was doing mobile searches. Today I looked at it and it seems like every account seems to error out with this same error when trying to complete mobile searches. Everything else seems to work flawlessly besides the mobile section.

   File "J:\PythonProjects\bingRewards\BingRewards\main.py", line 424, in login
     driver.find_element(By.XPATH, value='//*[@id="idSIButton9"]').click()
   File "C:\Users\johnn\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 857, in find_element
     return self.execute(Command.FIND_ELEMENT, {
   File "C:\Users\johnn\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 435, in execute
     self.error_handler.check_response(response)
   File "C:\Users\johnn\AppData\Local\Programs\Python\Python310\lib\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":"xpath","selector":"//*[@id="idSIButton9"]"}
   (Session info: headless chrome=114.0.5735.199)
 Stacktrace:
 Backtrace:
       GetHandleVerifier [0x0037A813+48355]
       (No symbol) [0x0030C4B1]
       (No symbol) [0x00215358]
       (No symbol) [0x002409A5]
       (No symbol) [0x00240B3B]
       (No symbol) [0x0026E232]
       (No symbol) [0x0025A784]
       (No symbol) [0x0026C922]
       (No symbol) [0x0025A536]
       (No symbol) [0x002382DC]
       (No symbol) [0x002393DD]
       GetHandleVerifier [0x005DAABD+2539405]
       GetHandleVerifier [0x0061A78F+2800735]
       GetHandleVerifier [0x0061456C+2775612]
       GetHandleVerifier [0x004051E0+616112]
       (No symbol) [0x00315F8C]
       (No symbol) [0x00312328]
       (No symbol) [0x0031240B]
       (No symbol) [0x00304FF7]
       BaseThreadInitThunk [0x750A7D59+25]
       RtlInitializeExceptionChain [0x7731B79B+107]
       RtlClearBits [0x7731B71F+191]


 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "J:\PythonProjects\bingRewards\BingRewards\main.py", line 439, in login
     message = driver.find_element(By.XPATH, value='//*[@id="iPageTitle"]').text
   File "C:\Users\johnn\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 857, in find_element
     return self.execute(Command.FIND_ELEMENT, {
   File "C:\Users\johnn\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 435, in execute
     self.error_handler.check_response(response)
   File "C:\Users\johnn\AppData\Local\Programs\Python\Python310\lib\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":"xpath","selector":"//*[@id="iPageTitle"]"}
   (Session info: headless chrome=114.0.5735.199)
 Stacktrace:
 Backtrace:
       GetHandleVerifier [0x0037A813+48355]
       (No symbol) [0x0030C4B1]
       (No symbol) [0x00215358]
       (No symbol) [0x002409A5]
       (No symbol) [0x00240B3B]
       (No symbol) [0x0026E232]
       (No symbol) [0x0025A784]
       (No symbol) [0x0026C922]
       (No symbol) [0x0025A536]
       (No symbol) [0x002382DC]
       (No symbol) [0x002393DD]
       GetHandleVerifier [0x005DAABD+2539405]
       GetHandleVerifier [0x0061A78F+2800735]
       GetHandleVerifier [0x0061456C+2775612]
       GetHandleVerifier [0x004051E0+616112]
       (No symbol) [0x00315F8C]
       (No symbol) [0x00312328]
       (No symbol) [0x0031240B]
       (No symbol) [0x00304FF7]
       BaseThreadInitThunk [0x750A7D59+25]
       RtlInitializeExceptionChain [0x7731B79B+107]
       RtlClearBits [0x7731B71F+191]


 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "J:\PythonProjects\bingRewards\BingRewards\main.py", line 1248, in mobile_helper
     mobile_search(driver, EMAIL, PASSWORD, MOBILE_SEARCHES)
   File "J:\PythonProjects\bingRewards\BingRewards\main.py", line 1208, in mobile_search
     login(EMAIL, PASSWORD, driver)
   File "J:\PythonProjects\bingRewards\BingRewards\main.py", line 448, in login
     driver.find_element(By.XPATH, value='//*[@id="idSIButton9"]').click()
   File "C:\Users\johnn\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 857, in find_element
     return self.execute(Command.FIND_ELEMENT, {
   File "C:\Users\johnn\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 435, in execute
     self.error_handler.check_response(response)
   File "C:\Users\johnn\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
     raise exception_class(message, screen, stacktrace)0x00240B3B
 selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="idSIButton9"]"}
   (Session info: headless chrome=114.0.5735.199)
 Stacktrace:
 Backtrace:
       GetHandleVerifier [0x0037A813+48355]
       (No symbol) [0x0030C4B1]
       (No symbol) [0x00215358]
       (No symbol) [0x002409A5]
       (No symbol) [0x00240B3B]
       (No symbol) [0x0026E232]
       (No symbol) [0x0025A784]
       (No symbol) [0x0026C922]
       (No symbol) [0x0025A536]
       (No symbol) [0x002382DC]
       (No symbol) [0x002393DD]
       GetHandleVerifier [0x005DAABD+2539405]
       GetHandleVerifier [0x0061A78F+2800735]
       GetHandleVerifier [0x0061456C+2775612]
       GetHandleVerifier [0x004051E0+616112]
       (No symbol) [0x00315F8C]
       (No symbol) [0x00312328]
       (No symbol) [0x0031240B]
       (No symbol) [0x00304FF7]
       BaseThreadInitThunk [0x750A7D59+25]
       RtlInitializeExceptionChain [0x7731B79B+107]
       RtlClearBits [0x7731B71F+191]


 Attempting to restart Mobile search in 500 seconds
 Error fetching points breakdown.```

I think I found the issue when logging into a Microsoft account for the first time on a "mobile" device, it wants you to hit continue to confirm some extra stuff on the account. It appears there isn't a check for this, as it assumes each account has already been logged in on mobile before or just was overlooked. I was able to fix it by making it not headless, and pressing the continue button as it does not ask you again after you have pressed it once. Thought you should know for others who use new accounts.