0

Im' testing ticket search form on http://www.go2see.ru trying to get access to it elements: button, fields. I need to fill 2-nd text field "Destination". I using following code and got following exception:

from splinter import Browser

browser = Browser()

# Fill in the url
browser.visit('http://www.go2see.ru')

#find and fill 2-nd text field (Destination), right of two air planes 
browser.find_by_id('avia-to').first.find_by_tag('input').fill('Moscow') 

File "/home/ada015/search_form_testing.py", line 9, in <module>
  browser.find_by_id('avia-to').first.find_by_tag('input').fill('Moscow')
File "/usr/local/lib/python2.7/dist-packages/splinter/element_list.py", line 75, in __getattr__
  self.__class__.__name__, name))

AttributeError: 'ElementList' object has no attribute 'fill'
  • `find_by_tag('input')` returns a list of elements, not a single element. You probably need to use `find_by_tag('input').first.fill` – Lukas Graf Mar 17 '14 at 17:18
  • @Lukas Graf I tried: `browser.find_by_id('avia-to').first.find_by_tag("input").first.fill('Moscow')` Have error: `splinter.exceptions.ElementDoesNotExist: no elements could be found with tag "input"` I also checked html, it looks like: `` – dmitrysbor Mar 18 '14 at 10:54

0 Answers0