webdriver之py,driver启动chrome时加载profile

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


executable_path = "path_to_webdriver"
os.environ["webdriver.chrome.driver"] = executable_path

chrome_options = Options()
chrome_options.add_extension('path_to_extension')

driver = webdriver.Chrome(executable_path=executable_path, chrome_options=chrome_options)
driver.get("http://baidu.com")
driver.quit()

 

posted on 2013-08-08 16:04  张飞_  阅读(3029)  评论(0编辑  收藏  举报

导航