I am new to python and trying to learn Selenium with python. But when i execute the code the tab opensup and getting closed automatically after loading the url.i never face this issue using selenium with java. Can anyone suggest me some solution
here's the code
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
ser_obj = Service("D:\\Python\\chromedriver-win64\\chromedriver.exe")
driver = webdriver.Chrome(service=ser_obj)
driver.get("https://gmail.com")
That's because your Python script closes after it's done executing your commands. You can add
input("Press enter to quit")
to stop this closing from happening.Please try this out and let me know if it helps at all.