我找不到登录文本框。我可以选择表格,但找不到输入文本。有人能帮我吗?
我正在尝试在http://www.safilonet.safilo.com/上使用此脚本自动登录 谢谢
这是代码和错误消息:
def login(self):
url = self._baseUrl + '/webapp/commerce/safilo/jsp/logon.jsp?lng=E&cpy=10'
self._br.open(url, timeout=30.0)
self._br.select_form(name='logon')
print 'entrou'
self._br.form['login'] = self._username
self._br.form['password'] = self._password
self._br.submit()
if self._verbose: print 'Login successful.\n'
self.last_logged_in = datetime.datetime.now()
错误信息:
Traceback (most recent call last):
File "E:\billy\Projects\GlassInteg\trunk\src\run.py", line 90, in <module> go()
File "E:\billy\Projects\GlassInteg\trunk\src\run.py", line 39, in go ss = SafiloSupplier(updateBrands=True)
File "E:\billy\Projects\GlassInteg\trunk\src\GlassInteg\Supplier.py", line 283, in __init__
if login: self.login()
File "E:\billy\Projects\GlassInteg\trunk\src\GlassInteg\Supplier.py", line 307, in login
self._br.form['login'] = self._username
File "build\bdist.win32\egg\mechanize\_form.py", line 2780, in __setitem__
File "build\bdist.win32\egg\mechanize\_form.py", line 3101, in find_control
File "build\bdist.win32\egg\mechanize\_form.py", line 3185, in _find_control
mechanize._form.ControlNotFoundError:没有控件匹配名称“登录”