Everytime I run this code the window opens blank and then loads the required page for about 1 second before closing.
from selenium import webdriver driver = w
One of the best possible workarounds is to set Sleep(), so that the browser doesn't close:
Sleep()
import time driver.get('https://www.google.com') time.sleep(3000) #this makes browser not to close.
Additional reading https://selenium-python.readthedocs.io/waits.html