selenium WebDriverを利用して、自動化ツールを作成しています。
ブラウザは、Firefoxを使っていますが、プライベートウィンドウで Firefoxを開くことは可能なのでしょうか?(Firefoxのプライベートウインドウだけではなく、Chromeのシークレットモードで対応が可能であればその情報でも助かります。)
seleniumを起動している環境は、Windows10です。
ブラウザを開く処理は以下のような処理で構築をしています。
python
1# coding: utf-8 2 3# ブラウザのプロフィール作成 4from selenium.webdriver import FirefoxProfile 5default_profile = { 6 'security.warn_entering_secure': False, 7 'security.warn_entering_secure.show_once': True, 8 'security.warn_entering_weak': False, 9 'security.warn_entering_weak._show_once': True, 10 'security.warn_leaving_secure': False, 11 'security.warn_leaving_secure.show_once': True, 12 'security.warn_leaving_weak': False, 13 'security.warn_leaving_weak._show_once': True, 14 'security.warn_submit_insecure': False, 15 'security.warn_viewing_mixed': False, 16 'security.warn_viewing_mixed.show_once': True, 17 } 18profile = FirefoxProfile() 19for name, value in default_profile.items(): 20 profile.set_preference(name, value) 21 22# プロキシの設定を作成 23from selenium.webdriver import Proxy 24proxy = Proxy() 25proxy.ftp_proxy = proxy.ssl_proxy = proxy.http_proxy = None 26 27# Firefoxを起動 28from selenium.webdriver import Firefox 29browser = Firefox(firefox_profile=profile, proxy=proxy) 30 31# URLを指定してそのページに遷移 32url = 'http://www.yahoo.co.jp/' 33browser.get(url) 34
よろしくお願いいたします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/06 06:13