Skip to content Skip to sidebar Skip to footer

Python And Selenium - Reuse A Whatsapp Web Session

I want to reuse a whatsapp web session via Python 3 and Selenium on Chromedriver. For which I need to grab the localstorage of an existing session and set it to the new browser ins

Solution 1:

this is how you can reuse a whatsapp web session by storing cookies.

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chrome_options = Options()
chrome_options.add_argument("--user-data-dir=chrome-data")
driver = webdriver.Chrome('chromedriver.exe',options=chrome_options)
driver.get('https://web.whatsapp.com')
time.sleep(30)

Post a Comment for "Python And Selenium - Reuse A Whatsapp Web Session"