How to select a field and type in it with selenium?

0

I'm trying to select the input field but I'm not getting it.

Error

Traceback (most recent call last):
  File "C:\Users\Pichau\Desktop\Teste.py", line 7, in <module>
    elem.clear()
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webelement.py", line 95, in clear
    self._execute(Command.CLEAR_ELEMENT)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webelement.py", line 628, in _execute
    return self._parent.execute(command, params)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 312, in execute
    self.error_handler.check_response(response)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
WebDriverException: Message: unknown error: call function result missing 'value'
  (Session info: chrome=66.0.3359.139)
  (Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.16299 x86_64)

HTML

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
<form>
    <input type="text" name="arroz" id="feijao">
</form>
</body>
</html>

Python

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome(executable_path=r"C:\chromedriver.exe")
driver.get("http://sisbibliotec.com.br/a.html")
elem = driver.find_element_by_name('arroz')
elem.clear()
elem.send_keys('username')
    
asked by anonymous 03.05.2018 / 22:26

1 answer

1

It may be the version of the driver you are using, some functions may stop working between the transition from one version to another.

You can always get the latest version of the Chrome driver here:

link

    
03.05.2018 / 23:13