-1

i use some script in python in order to retrieve datas from my online bank. That is doing at first step:

driver = webdriver.Firefox()
driver.implicitly_wait(15) # seconds

driver.get('https://www.caisse-epargne.fr/particuliers/cote-d-azur/page_accessibilite.aspx')
time.sleep(2) 
driver.find_element_by_id('checkBoxClavier').click()                            
driver.find_element_by_id('ctl01_CC_page_accessibilite_valider').click()        # click su 'Valider'

...but the link is not followed! I tried several solution (put sleep, add implicit wait etc...) but without any result. Selenium Version: 2.48 Firefox: 42.0 The funny is that the very same script is working for a much older version of Firefox (20), run on a virtual machine, but now i am in need to run the version on the last Firefox. Any suggestion?

Regards

gp77
  • 1
  • 1

2 Answers2

0

I visited the website and verified that #checkBoxClavier is a checkbox. It seems that Selenium doesn't interact in the same way with identical elements across different browsers; checkboxes are one of those elements.

If a click isn't working to check your checkbox on Firefox, one suggestion -- see here -- is to try to simulate a spacebar press on that element. Something like this:

from selenium.webdriver.common.keys import Keys
driver.find_element_by_id('checkBoxClavier').send_keys( Keys.SPACE )
Community
  • 1
  • 1
Andre Gregori
  • 1,150
  • 1
  • 10
  • 17
  • Still not working. The checkbox is checked (but it was also checked with older method), nevertheless the "Valider" Button is not pressed. – gp77 Dec 07 '15 at 07:39
-1

Problem Solved :) Inspired by last suggestion, i did this:

    elem = driver.find_element_by_id('ctl01_CC_page_accessibilite_valider')
    time.sleep(0.2)
    elem.send_keys( Keys.ENTER)

It looks that newer Firefox versions have some issues with .click() event....

gp77
  • 1
  • 1
  • This is an old answer, but for those having this problem in the future, `time.sleep` in this situation is unreliable. You can use [WebDriverWait](http://selenium-python.readthedocs.io/waits.html) to have Selenium actually wait for a condition (the existence of an element, the value of an attribute, etc.) rather than an arbitrary wait like this that may end up not being long enough in some circumstances. – kungphu Apr 10 '18 at 02:18