I've got a crunchy scraping problem in my hands with a lot of javascript that creates session-dependent cookies and I am trying to bypass this question using selenium. I'm using the python driver (python-selenium, version 2.2.0-1 on debian). Without the Remote Driver obtained from selenium-server-standalone-2.39.0.jar the browser was starting but not working (it reported some profile issues). Using the Remote Driver everything is fine except that set_preference is not working (I need to define a browser_profile in order to be able to automatically save some files):
profile = webdriver.FirefoxProfile()
profile.set_preference('browser.download.folderList', 2) # custom location
profile.set_preference('browser.download.manager.showWhenStarting', False)
profile.set_preference('browser.download.dir', '/tmp')
profile.set_preference('browser.helperApps.neverAsk.saveToDisk', 'application/pdf')
profile.set_preference('browser.helperApps.neverAsk.saveToDisk', 'application/pdf')
#browser = webdriver.Firefox()
browser = webdriver.Remote(
command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities=DesiredCapabilities.FIREFOX, browser_profile=profile)
In this way not only the dialog with the save/open choice is opened but examining about:config I do not find the confs to have been set. On this debian I've got Iceweasel 24.2.0 but I've also tried on a ubuntu with plain firefox with no luck.
Any idea about what could be my problem?