jared 2 年之前
父節點
當前提交
ef8b8af826
共有 1 個文件被更改,包括 5 次插入2 次删除
  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