2016-10-17 11 views

答えて

0

出典Using Extensions with Selenium (Python):私はトップに投稿するようにあなたがあなたのブラウザで標準のプロファイルを持っているセレンで

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://stackoverflow.com") 
driver.quit() 

は、クロムことがあります。 firefoxの場合:

fp = webdriver.FirefoxProfile() 
fp.set_preference("dom.max_chrome_script_run_time", 0) 
fp.set_preference("dom.max_script_run_time", 0) 
Driver = webdriver.Firefox(firefox_profile=fp) 
関連する問題