open Wattsapp web using selenium

17 views
Skip to first unread message

Mina Emad

unread,
Feb 12, 2025, 10:36:56 PM2/12/25
to Selenium Users
Hi everyone 
I'm using the following code to open Watsapp web on edge browser, the problem is that I have to log in every time though the written code should open the app directly with no need to log in every time as I already logged in before.
So, what Is the problem of the code especially I have followed tutorials that shows it's working fine
here is script 
 from selenium import webdriver
from selenium.webdriver.edge.service import Service


userdatadir = 'C:/Users/DRMINA2019/AppData/Local/Microsoft/Edge/User Data/Default'
edge_options = webdriver.EdgeOptions()
edge_options.add_experimental_option("detach",True)
edge_options.add_argument(f"--user-data-dir={userdatadir}")


service = Service(executable_path='edgedriver_win64/msedgedriver.exe')


driver = webdriver.Edge(service=service, options=edge_options)
driver.implicitly_wait(60) # gives an implicit wait for 60 seconds
Reply all
Reply to author
Forward
0 new messages