'Python: Selenium Chrome Driver opens blank page
When running this simple code a blank page opens with 'data:,' written in the url. Chrome driver is the correct version (ChromeDriver 81.0.4044.69) and matches my GoogleChrome version (81.0.4044.122). Selenium updated also (3.141.0)
I have also added the driver's folder to the systems' PATH. Also tried with http instead of https in the url.
from selenium import webdriver
class GoogleBot:
def __init__(self):
self.driver = webdriver.Chrome(executable_path="C:\Drivers\chromedriver.exe")
driver.get("https://www.google.es/")
GoogleBot()
Solution 1:[1]
In your code you have used driver
intead of self.driver
. please refer below code to resolve your issue ::
from selenium import webdriver
class GoogleBot:
def __init__(self):
self.driver = webdriver.Chrome(executable_path=r"path for chromedriver.exe")
def googleTest(self):
self.driver.get("https://www.google.es/")
self.driver.close()
if __name__ == "__main__":
GoogleBot = GoogleBot()
GoogleBot.googleTest()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | SeleniumUser |