This commit is contained in:
zhaoyafan 2023-05-07 17:00:55 +08:00
parent cd297b70a9
commit 34ee4f22a5
1 changed files with 2 additions and 1 deletions

View File

@ -622,11 +622,12 @@ class Browser(browser_webdriver):
options.add_argument(i)
# Set headless mode.
if self.is_linux or headless:
options.add_argument('--headless=new')
options.add_argument('--headless=new' if browser_choose != 1 else '--headless')
# Set no-sandbox mode.
if self.is_linux:
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
if self.is_linux and browser_choose != 1:
options.add_argument('--disable-gpu')
# Set language of browser, default is zh-CN.
if lang: