charlesbel / Microsoft-Rewards-Farmer

A simple bot that uses selenium to farm Microsoft Rewards written in Python
MIT License
975 stars 261 forks source link

[BUG] Program crash in headless #432

Open Beusts opened 7 months ago

Beusts commented 7 months ago

Before submitting a bug report...

Title

Describe the bug

the program crash in headless

Python 3.11.4 selenium 4.11.2 requests 2.31.0 ipapi 1.0.4 undetected-chromedriver 3.5.4 selenium-wire 5.1.0

OS : 10.0.22631 N/A build 22631 Microsoft Windows 11 Famille

Copy and paste your error

D:\Downloads\Microsoft-Rewards-Farmer-master>python autoupdate_main.py Starting... 2024-01-26 00:01:57,524 [INFO] ****Fabbrichard@outlook.fr**** 2024-01-26 00:01:57,989 [INFO] Using default request storage 2024-01-26 00:01:58,018 [INFO] Created proxy listening on 127.0.0.1:55610 2024-01-26 00:01:58,019 [INFO] Using undetected_chromedriver 2024-01-26 00:01:58,488 [INFO] patching driver executable C:\Users\sonic\appdata\roaming\undetected_chromedriver\undetected_chromedriver.exe 2024-01-26 00:01:59,191 [INFO] Screen size: 1279x1104 2024-01-26 00:01:59,191 [INFO] Device size: 1224x953 2024-01-26 00:01:59,325 [INFO] [LOGIN] Logging-in... 2024-01-26 00:02:11,856 [INFO] [LOGIN] Logged-in ! 2024-01-26 00:02:18,924 [INFO] [LOGIN] Ensuring login on Bing... 2024-01-26 00:02:24,139 [INFO] [LOGIN] Logged-in successfully ! 2024-01-26 00:02:24,141 [INFO] [POINTS] You have 420,00 points on your account ! 2024-01-26 00:02:24,142 [INFO] [DAILY SET] Trying to complete the Daily Set... 2024-01-26 00:02:34,923 [INFO] [DAILY SET] Completing search of card 1 2024-01-26 00:02:42,385 [ERROR] NoSuchWindowException: Message: no such window: target window already closed from unknown error: web view not found (Session info: chrome=121.0.6167.85) Stacktrace: GetHandleVerifier [0x00BF1673+52979] (No symbol) [0x00B77961] (No symbol) [0x00A5DD3D] (No symbol) [0x00A4239A] (No symbol) [0x00ABA71B] (No symbol) [0x00ACACB6] (No symbol) [0x00AB4286] (No symbol) [0x00A8C063] (No symbol) [0x00A8CECD] GetHandleVerifier [0x00F08D83+3294723] GetHandleVerifier [0x00F46CC2+3548482] GetHandleVerifier [0x00F41C9C+3527964] GetHandleVerifier [0x00C8870E+671630] (No symbol) [0x00B81EB4] (No symbol) [0x00B7D808] (No symbol) [0x00B7D92D] (No symbol) [0x00B6F7E0] BaseThreadInitThunk [0x75747BA9+25] RtlInitializeExceptionChain [0x7726BD2B+107] RtlClearBits [0x7726BCAF+191]

Traceback (most recent call last): File "D:\Downloads\Microsoft-Rewards-Farmer-master\src\dailySet.py", line 25, in completeDailySet self.activities.openDailySetActivity(cardId) File "D:\Downloads\Microsoft-Rewards-Farmer-master\src\activities.py", line 15, in openDailySetActivity self.webdriver.find_element( File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 739, in find_element return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 345, in execute self.error_handler.check_response(response) File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, 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="daily-sets"]/mee-card-group[1]/div/mee-card[2]/div/card-content/mee-rewards-daily-set-item-content/div/a"} (Session info: chrome=121.0.6167.85); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception Stacktrace: GetHandleVerifier [0x00BF1673+52979] (No symbol) [0x00B77961] (No symbol) [0x00A5DD3D] (No symbol) [0x00A95FBB] (No symbol) [0x00A960FB] (No symbol) [0x00ACCF92] (No symbol) [0x00AB4534] (No symbol) [0x00ACB3FE] (No symbol) [0x00AB4286] (No symbol) [0x00A8C063] (No symbol) [0x00A8CECD] GetHandleVerifier [0x00F08D83+3294723] GetHandleVerifier [0x00F46CC2+3548482] GetHandleVerifier [0x00F41C9C+3527964] GetHandleVerifier [0x00C8870E+671630] (No symbol) [0x00B81EB4] (No symbol) [0x00B7D808] (No symbol) [0x00B7D92D] (No symbol) [0x00B6F7E0] BaseThreadInitThunk [0x75747BA9+25] RtlInitializeExceptionChain [0x7726BD2B+107] RtlClearBits [0x7726BCAF+191]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\switch_to.py", line 141, in _w3c_window send_handle(window_name) File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\switch_to.py", line 137, in send_handle self._driver.execute(Command.SWITCH_TO_WINDOW, {"handle": h}) File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 345, in execute self.error_handler.check_response(response) File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchWindowException: Message: no such window (Session info: chrome=121.0.6167.85) Stacktrace: GetHandleVerifier [0x00BF1673+52979] (No symbol) [0x00B77961] (No symbol) [0x00A5DC00] (No symbol) [0x00AC062A] (No symbol) [0x00AB44B3] (No symbol) [0x00A8C063] (No symbol) [0x00A8CECD] GetHandleVerifier [0x00F08D83+3294723] GetHandleVerifier [0x00F46CC2+3548482] GetHandleVerifier [0x00F41C9C+3527964] GetHandleVerifier [0x00C8870E+671630] (No symbol) [0x00B81EB4] (No symbol) [0x00B7D808] (No symbol) [0x00B7D92D] (No symbol) [0x00B6F7E0] BaseThreadInitThunk [0x75747BA9+25] RtlInitializeExceptionChain [0x7726BD2B+107] RtlClearBits [0x7726BCAF+191]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Downloads\Microsoft-Rewards-Farmer-master\src\utils.py", line 76, in resetTabs self.webdriver.switch_to.window(curr) File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\switch_to.py", line 133, in window self._w3c_window(window_name) File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\switch_to.py", line 144, in _w3c_window original_handle = self._driver.current_window_handle ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\undetected_chromedriver__init.py", line 806, in getattribute return super().getattribute__(item) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 481, in current_window_handle return self.execute(Command.W3C_GET_CURRENT_WINDOW_HANDLE)["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 345, in execute self.error_handler.check_response(response) File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchWindowException: Message: no such window: target window already closed from unknown error: web view not found (Session info: chrome=121.0.6167.85) Stacktrace: GetHandleVerifier [0x00BF1673+52979] (No symbol) [0x00B77961] (No symbol) [0x00A5DD3D] (No symbol) [0x00A4239A] (No symbol) [0x00ABA71B] (No symbol) [0x00ABF61B] (No symbol) [0x00AB44B3] (No symbol) [0x00A8C063] (No symbol) [0x00A8CECD] GetHandleVerifier [0x00F08D83+3294723] GetHandleVerifier [0x00F46CC2+3548482] GetHandleVerifier [0x00F41C9C+3527964] GetHandleVerifier [0x00C8870E+671630] (No symbol) [0x00B81EB4] (No symbol) [0x00B7D808] (No symbol) [0x00B7D92D] (No symbol) [0x00B6F7E0] BaseThreadInitThunk [0x75747BA9+25] RtlInitializeExceptionChain [0x7726BD2B+107] RtlClearBits [0x7726BCAF+191]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Downloads\Microsoft-Rewards-Farmer-master\main.py", line 24, in main executeBot(currentAccount, notifier, args) File "D:\Downloads\Microsoft-Rewards-Farmer-master\main.py", line 133, in executeBot DailySet(desktopBrowser).completeDailySet() File "D:\Downloads\Microsoft-Rewards-Farmer-master\src\dailySet.py", line 81, in completeDailySet self.browser.utils.resetTabs() File "D:\Downloads\Microsoft-Rewards-Farmer-master\src\utils.py", line 80, in resetTabs self.goHome() File "D:\Downloads\Microsoft-Rewards-Farmer-master\src\utils.py", line 86, in goHome self.webdriver.get(BASE_URL) File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\undetected_chromedriver__init__.py", line 496, in get_wrapped if self.execute_script("return navigator.webdriver"): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 405, in execute_script return self.execute(command, {"script": script, "args": converted_args})["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 345, in execute self.error_handler.check_response(response) File "C:\Users\sonic\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchWindowException: Message: no such window: target window already closed from unknown error: web view not found (Session info: chrome=121.0.6167.85) Stacktrace: GetHandleVerifier [0x00BF1673+52979] (No symbol) [0x00B77961] (No symbol) [0x00A5DD3D] (No symbol) [0x00A4239A] (No symbol) [0x00ABA71B] (No symbol) [0x00ACACB6] (No symbol) [0x00AB4286] (No symbol) [0x00A8C063] (No symbol) [0x00A8CECD] GetHandleVerifier [0x00F08D83+3294723] GetHandleVerifier [0x00F46CC2+3548482] GetHandleVerifier [0x00F41C9C+3527964] GetHandleVerifier [0x00C8870E+671630] (No symbol) [0x00B81EB4] (No symbol) [0x00B7D808] (No symbol) [0x00B7D92D] (No symbol) [0x00B6F7E0] BaseThreadInitThunk [0x75747BA9+25] RtlInitializeExceptionChain [0x7726BD2B+107] RtlClearBits [0x7726BCAF+191]

Screenshots

in headless the program works

Value of dashboard variable

https://gist.github.com/Beusts/9555ee18fe0f4d8f688432b869e4da47#file-gistfile1-txt

iDarkSnow commented 7 months ago

I have the same issues but it only happens on one account of the two i am using

Natriumpikant commented 7 months ago

I have the same issues but it only happens on one account of the two i am using

Exact the same for me.