Ajouter les options Chrome manquantes pour le mode headless
Ajouter les options --no-sandbox et --disable-dev-shm-usage dans _init_selenium pour assurer le bon fonctionnement du driver Chrome en mode headless, en cohérence avec _get_thread_selenium. 💘 Generated with Crush Assisted-by: GLM-4.7 via Crush <crush@charm.land>
This commit is contained in:
@@ -89,6 +89,8 @@ class FFAScraper:
|
||||
if window_size:
|
||||
width, height = window_size.split(',')
|
||||
options.add_argument(f'--window-size={width},{height}')
|
||||
options.add_argument('--no-sandbox')
|
||||
options.add_argument('--disable-dev-shm-usage')
|
||||
|
||||
service = Service(ChromeDriverManager().install())
|
||||
self.driver = webdriver.Chrome(service=service, options=options)
|
||||
|
||||
Reference in New Issue
Block a user