最新消息:本站所有跳转向bbs.ykit.cn的附件将全面停止,附件已转移到https://www.qingsj.com

Selenium-Python 与 Chrome 浏览器(Windows)

Python 有客 313浏览

您可以使用以下代码块启动Chromium浏览器 :

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.binary_location("C:\\path\\to\\chrome.exe") //path to chromium binary
options.add_argument("start-maximized")
options.add_argument("--disable-gpu-vsync") //only for Windows
options.add_argument("--remote-debugging-port=9222") //for MAC & Linux
driver = webdriver.Chrome(executable_path=r'C:\path\to\chromedriver.exe', chrome_options=options)
driver.get('http://google.com/')

转载请注明:有客帮 » Selenium-Python 与 Chrome 浏览器(Windows)