42

Selenium Webdriver (Python) を使用して、何千ものファイルのダウンロードを自動化しています。Chrome のダウンロード フォルダをプログラムで設定したい。これを読んだ後、私はこれを試しました:

chromepath = '/Users/thiagomarzagao/Desktop/searchcode/chromedriver'
desired_caps = {'prefs': {'download': {'default_directory': '/Users/thiagomarzagao/Desktop/downloaded_files/'}}}
driver = webdriver.Chrome(executable_path = chromepath, desired_capabilities = desired_caps)

ダメ。ダウンロードは引き続きデフォルトのダウンロード フォルダー ("/Users/thiagomarzagao/Downloads") に移動します。

何かご意見は?

(Python 2.7.5、Selenium 2.2.0、Chromedriver 2.1.210398、Mac OS X 10.6.8)

4

8 に答える 8