mirror of
https://github.com/tcsenpai/agenticSeek.git
synced 2025-06-07 03:25:32 +00:00
fix : SessionNotCreatedException caused by data dir conflict
This commit is contained in:
parent
3c66eb646e
commit
9a1b2b93f6
@ -17,6 +17,7 @@ import time
|
|||||||
import random
|
import random
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import tempfile
|
||||||
import markdownify
|
import markdownify
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
@ -59,6 +60,8 @@ def create_driver(headless=False, stealth_mode=True) -> webdriver.Chrome:
|
|||||||
#ua = UserAgent()
|
#ua = UserAgent()
|
||||||
#user_agent = ua.random # NOTE sometime return wrong user agent, investigate
|
#user_agent = ua.random # NOTE sometime return wrong user agent, investigate
|
||||||
#chrome_options.add_argument(f'user-agent={user_agent}')
|
#chrome_options.add_argument(f'user-agent={user_agent}')
|
||||||
|
user_data_dir = tempfile.mkdtemp()
|
||||||
|
chrome_options.add_argument(f"--user-data-dir={user_data_dir}")
|
||||||
chrome_options.add_argument("--no-sandbox")
|
chrome_options.add_argument("--no-sandbox")
|
||||||
chrome_options.add_argument("--disable-dev-shm-usage")
|
chrome_options.add_argument("--disable-dev-shm-usage")
|
||||||
chrome_options.add_argument("--autoplay-policy=user-gesture-required")
|
chrome_options.add_argument("--autoplay-policy=user-gesture-required")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user