ultrafunkamsterdam / undetected-chromedriver

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
https://github.com/UltrafunkAmsterdam/undetected-chromedriver
GNU General Public License v3.0
9.69k stars 1.14k forks source link

Whatsapp Web Session Keeps Disconnecting using UC #1269

Open rafamelo01 opened 1 year ago

rafamelo01 commented 1 year ago

No message errors, im using user data Dir to save profile session, cookies etc, but session keeps disconnecting and needing another QR CODE scan, can i do something to reduce that need of another login?

my uc.Chrome flags and userdatadir argument

def criarDriver(nomeProfile, sender: Sender) -> uc.Chrome: return uc.Chrome(user_data_dir="mypath", options=setarPerfil(), version_main=113)

def setarPerfil():
    chrome_options = uc.ChromeOptions()
    chrome_options.add_argument("--headless=new")
    chrome_options.add_argument("--disable-blink-features=AutomationControlled")
    chrome_options.add_argument("--ignore-certificate-errors")
    chrome_options.add_argument("--start-maximized")
    chrome_options.add_argument('--disable-dev-shm-usage')
    chrome_options.add_argument('--disable-gpu')
    chrome_options.add_argument("--disable-notifications")
    chrome_options.add_argument('--no-sandbox')
    chrome_options.add_argument("--disable-extensions")
    chrome_options.add_argument('--disable-popup-blocking')
    chrome_options.add_argument("user-agent={}".format(USER_AGENT))
    return chrome_options
rafamelo01 commented 1 year ago

Maybe if there's a way to keep the driver session active even if I close all the tabs, it would avoid me having to reopen the connection every period of time, is there any way?