|
@@ -140,10 +140,13 @@ def restart_browser():
|
|
options.add_argument("--no-sandbox")
|
|
options.add_argument("--no-sandbox")
|
|
options.add_argument("--disable-dev-shm-usage")
|
|
options.add_argument("--disable-dev-shm-usage")
|
|
options.add_argument('--headless')
|
|
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")
|
|
options.add_argument("--incognito")
|
|
try:
|
|
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)
|
|
#driver = webdriver.Remote(command_executor='http://127.0.0.1:'+str(portnum)+'/wd/hub',options=options)
|
|
except:
|
|
except:
|
|
return None
|
|
return None
|