My goal is to perform simple logout action with Selenium for certain website (ex: facebook, twitter etc) based on command I input into python program.
Driver = webdriver.Firefox(executable_path=PATH)
Driver.get("https://Faceboook.com/")
logout = Driver.find_element_by_id('logout')
logout.Click()
but webdriver will not recognize previous session from existing browser, thus it show login page of facebook and cannot perform logout even though I already login from existing Firefox browser.
I have been searching but can't find the solution how to connect a session without creating new webdriver and passing the session.
executor_url = driver.command_executor._url
session_id = driver.session_id
Does anybody know if I can use existing session from Firefox in Selenium?