Jared 3 gadi atpakaļ
vecāks
revīzija
66d4d2a301
1 mainītis faili ar 7 papildinājumiem un 3 dzēšanām
  1. 7 3
      hhh/SEO/local_1777.py

+ 7 - 3
hhh/SEO/local_1777.py

@@ -45,9 +45,13 @@ def re_get_webdriver():
         print(user_agent)
         options.add_argument("--user-agent=" +user_agent)
         options.add_argument("--incognito")
-
-        driver = webdriver.Chrome(options=options)
-
+        driver=None
+        try:
+            driver = webdriver.Chrome(options=options)
+        except:
+            driver.quit()
+            sys.exit()
+            return
         driver.set_window_size(1400,1000)
         return
     except: