数据科学导论 安装Selenium+chromedriver.exe 测试代码

    科技2022-08-21  119

    //测试是否安装成功的代码 from selenium import webdriver#引入驱动器 from selenium.webdriver.chrome.options import Options options = Options() #chrome.exe的存放位置,不设置可能会报错 options.binary_location = "C:\Program Files\Google\Chrome\Application\chrome.exe" #设置chromedriver.exe的位置 driver = webdriver.Chrome(chrome_options=options, executable_path="D:\python\chromedriver.exe", ) #自动弹出百度页面 driver.get("http://www.baidu.com")

     

    Processed: 0.031, SQL: 9