简体   繁体   中英

Python Selenium Webdriver hangs

I recently upgraded from Firefox 16 to 29 Selenium 2.33 to 2.43

The previous set up is working fine but after upgradation I see it is hanging at the beginning step itself:

firefoxprofile = webdriver.FirefoxProfile(profile_directory = firefoxProfilePath)
firefoxprofile.set_preference('webdriver_assume_untrusted_issuer', False)
firefoxprofile.set_preference('webdriver_accept_untrusted_certs', True)
firefoxprofile.set_preference('browser.download.folderList', 2) # custom location
firefoxprofile.set_preference('browser.download.manager.showWhenStarting', False)
downloadLocation = os.path.join(os.getcwd(), 'results', config.IDL_IP)                           
firefoxprofile.set_preference('network.proxy.type', 0)
firefoxprofile.set_preference('browser.download.dir', downloadLocation)
firefoxprofile.set_preference('browser.helperApps.neverAsk.openFile', downloadFormat)
firefoxprofile.set_preference('browser.helperApps.neverAsk.saveToDisk', downloadFormat)
firefoxprofile.update_preferences()

firefoxdriver = webdriver.Firefox(firefox_profile=firefoxprofile )

it hangs at the final step I'm also running this on a headless server using Xvfb .

Most probably a firefox/selenium compatibility issue. Maybe this helps.

(I would have rather added a comment but I am 4 rep points short of doing so).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM