jared před 2 roky
rodič
revize
ef8b8af826
1 změnil soubory, kde provedl 5 přidání a 2 odebrání
  1. 5 2
      web/main.py

+ 5 - 2
web/main.py

@@ -140,10 +140,13 @@ def restart_browser():
         options.add_argument("--no-sandbox")
         options.add_argument("--disable-dev-shm-usage")
         options.add_argument('--headless')
-        # options.add_experimental_option("debuggerAddress", "127.0.0.1:9923")
+        #options.add_argument('--remote-debugging-port=9222')
+        #options.add_experimental_option("debuggerAddress", "127.0.0.1:9922")
         options.add_argument("--incognito")
         try:
-            driver = webdriver.Chrome(options=options,executable_path='/root/driver/chromedriver103')
+            driver = webdriver.Chrome(options=options)
+            str1 = driver.capabilities['chrome']['chromedriverVersion'].split(' ')[0]
+            print('這裡',str1)
             #driver = webdriver.Remote(command_executor='http://127.0.0.1:'+str(portnum)+'/wd/hub',options=options)
         except:
             return None