WebDriver in Python with Pycharm does not work

0

These are the imports:

  

Update to the latest version of Selenium

from lib2to3.pgen2 import driver
import time
from selenium import webdriver
import datetime
driver = webdriver.Chrome()
driver.maximize_window()

And here is the program that uses the driver:

 def mifuncion():

#driver.get("https://prenotaonline.esteri.it/login.aspx?cidsede=100064&returnUrl=%2f%2f")
driver.find_element_by_id("BtnLogin").click()
sbox = driver.find_element_by_id("UserName")
sbox.send_keys("[email protected]")
sbox = driver.find_element_by_id("Password")
sbox.send_keys("Fede1996")
time.sleep(5)
driver.find_element_by_id("BtnConfermaL").click()
driver.find_element_by_id("ctl00_repFunzioni_ctl00_btnMenuItem").click()
driver.find_element_by_id("ctl00_ContentPlaceHolder1_rpServizi_ctl01_btnNomeServizio").click()
driver.find_element_by_id("ctl00_ContentPlaceHolder1_rpServizi_ctl01_btnNomeServizio").click()
sbox = driver.find_element_by_id("ctl00_ContentPlaceHolder1_acc_datiAddizionali1_mycontrol1")
sbox.send_keys("1140488699")
driver.find_element_by_id("ctl00_ContentPlaceHolder1_acc_datiAddizionali1_btnContinua").click()

And these are the errors that I get, after having updated Debian:

 /usr/bin/python2.7 
/home/educacion/PycharmProjects/untitled/mimi/buenosaires.py
Traceback (most recent call last):
File "/home/educacion/PycharmProjects/untitled/mimi/buenosaires.py", 
line 67, in <module>
 mifuncion()
 File 
 "/home/educacion/PycharmProjects/untitled/mimi/buenosaires.py", 
 line 29, in mifuncion    driver.find_element_by_id("ctl00_ContentPlaceHolder1_acc_datiAddizionali1_btnContinua").click()
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 501, in _execute
    return self._parent.execute(command, params)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 308, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Element is not clickable at point (596, 768)
  (Session info: chrome=62.0.3202.94)
  (Driver info: chromedriver=2.28.455506 (18f6627e265f442aeec9b6661a49fe819aeeea1f),platform=Linux 3.16.0-4-amd64 x86_64)
    
asked by TOMAS 23.11.2017 в 21:38
source

1 answer

0

I solved it ... the problem was that I had updated Debian and Chrome, the Webdriver had been outdated .. I updated it (download it from here driver installer and install) .. and everything worked perfect ..

    
answered by 24.11.2017 / 13:12
source