noodles 1 year ago
parent
commit
2e06933de1
1 changed files with 4 additions and 2 deletions
  1. 4 2
      utility.py

+ 4 - 2
utility.py

@@ -13,12 +13,14 @@ import time
 
 def brower_start(port):
     options = webdriver.ChromeOptions()
-
+    options.add_argument("--no-sandbox")
+    options.add_argument("--disable-dev-shm-usage")
 #    browser = webdriver.Chrome(options=options)
 #    上面成功再來用docker
     browser = webdriver.Remote(
         command_executor='http://127.0.0.1:'+str(port)+'/wd/hub',
-        desired_capabilities=options.to_capabilities()
+        desired_capabilities=options.to_capabilities(), 
+        options=options
     )
     return browser