from selenium import webdriver # 登陆百度 def main(): chromedriver_path = r"C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe" driver = webdriver.Chrome(executable_path=chromedriver_path) # 打开页面 page = driver.get(‘https://www.baidu.com/‘) if __name__ == "__main__": main()
from selenium import webdriver chromedriver_path = r"C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe" driver = webdriver.Chrome(executable_path=chromedriver_path) # 登陆百度 def main(): # 打开页面 page = driver.get(‘https://www.baidu.com/‘) if __name__ == "__main__": main()
from selenium import webdriver # 登陆百度 def main(): global driver chromedriver_path = r"C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe" driver = webdriver.Chrome(executable_path=chromedriver_path) # 打开页面 page = driver.get(‘https://www.baidu.com/‘) if __name__ == "__main__": main()
非原创,自用记录
selenium、webdriver打开Chrome浏览器闪退问题(版本号也是一致时)
原文:https://www.cnblogs.com/Tgbshare/p/14817222.html