mirror of
https://github.com/User0332/rewards-farmer.git
synced 2026-09-16 01:31:36 +00:00
catch NoSuchWindowException in tab_utils
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
from selenium.common.exceptions import WebDriverException, JavascriptException
|
from selenium.common.exceptions import WebDriverException, JavascriptException, NoSuchWindowException
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
|
|
||||||
GHOST_TAB_URLS = (
|
GHOST_TAB_URLS = (
|
||||||
@@ -56,7 +56,7 @@ document.dispatchEvent(new Event('visibilitychange'));
|
|||||||
self.driver.close()
|
self.driver.close()
|
||||||
print(f"[INFO] Closed tab with handle {handle} and URL {tab_url}.")
|
print(f"[INFO] Closed tab with handle {handle} and URL {tab_url}.")
|
||||||
|
|
||||||
except WebDriverException:
|
except (WebDriverException, NoSuchWindowException):
|
||||||
print(f"[WARNING] Could not close tab with handle {handle} and URL {tab_url}.")
|
print(f"[WARNING] Could not close tab with handle {handle} and URL {tab_url}.")
|
||||||
self.problematic_tabs.add(handle)
|
self.problematic_tabs.add(handle)
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user