By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,362 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,362 IT Pros & Developers. It's quick & easy.

Unable to access textbox on an HTML form

P: 7
I've solved this problem... I had a little error on the path of the frame that i have to open to reach the form.

Now the form is being opened, but i can't find the login text box.

Can you help me @Rabbit?

Here is the code and the text message:

Expand|Select|Wrap|Line Numbers
  1.  
  2.  def login(self):
  3.         url = self._baseUrl + '/webapp/commerce/safilo/jsp/logon.jsp?lng=E&cpy=10'
  4.         self._br.open(url, timeout=30.0)
  5.         self._br.select_form(name='logon') 
  6.         print 'entrou'
  7.         self._br.form['login'] = self._username
  8.         self._br.form['password'] = self._password
  9.         self._br.submit()
  10.  
  11.         if self._verbose: print 'Login successful.\n'
  12.  
  13.         self.last_logged_in = datetime.datetime.now()
  14.  
  15. Traceback (most recent call last):
  16.   File "E:\billy\Projects\GlassInteg\trunk\src\run.py", line 90, in <module>
  17.     go()
  18.   File "E:\billy\Projects\GlassInteg\trunk\src\run.py", line 39, in go
  19.     ss = SafiloSupplier(updateBrands=True)
  20.   File "E:\billy\Projects\GlassInteg\trunk\src\GlassInteg\Supplier.py", line 283, in __init__
  21.     if login: self.login()
  22.   File "E:\billy\Projects\GlassInteg\trunk\src\GlassInteg\Supplier.py", line 307, in login
  23.     self._br.form['login'] = self._username
  24.   File "build\bdist.win32\egg\mechanize\_form.py", line 2780, in __setitem__
  25.   File "build\bdist.win32\egg\mechanize\_form.py", line 3101, in find_control
  26.   File "build\bdist.win32\egg\mechanize\_form.py", line 3185, in _find_control
  27. mechanize._form.ControlNotFoundError: no control matching name 'login'
  28.  
Oct 10 '12 #1
Share this Question
Share on Google+
3 Replies

Rabbit
Expert Mod 10K+
P: 12,441
@ATNC33, we try to limit threads to one question each. Since this is a new question, I have branched it from the original thread: http://bytes.com/topic/python/answers/943035-error-form.
Oct 10 '12 #2

P: 7
@Rabbit Thank you for your help! ;)
Oct 10 '12 #3

Expert 100+
P: 626
File "build\bdist.win32\egg\mechanize\_form.py", line 3185, in _find_control
mechanize._form.ControlNotFoundError: no control matching name 'login'
It appears there is no "login" on the form you are accessing. Print it to see what you have as the login page is apparently at a different location.
Oct 14 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.