废话不多说,直接上代码
import selenium.webdriver.chrome.webdriver as webdriver
from selenium.webdriver.chrome.options import Options,DesiredCapabilities
#one
options=Options()
options.binary_location = r"C:\chrome\bin\chrome.exe"
web driver.WebDriver(options=options)
#two
desiredCap = DesiredCapabilities.CHROME.copy()
chrome_options = dict()
chrome_options["binary"] = r"C:\chrome\bin\chrome.exe"
desiredCap["goog:chromeOptions"]=chrome_options
web driver.WebDriver(desired_capabilities=desiredCap)
网友评论