2

我正在尝试使用 python 选择一个表单,但它不起作用。

我正在使用的页面是:http: //www.safilonet.safilo.com/

def login(self):
    url = self._baseUrl + '/webapp/commerce/safilo/jsp/logon.jsp'
    self._br.open(url, timeout=30.0)
    self._br.select_form('logon')   
    self._br.form['login'] = self._username
    self._br.form['password'] = self._password
    self._br.submit()

出现的错误是:

File "build\bdist.win32\egg\mechanize\_mechanize.py", line 524, in select_form
mechanize._mechanize.FormNotFoundError: no form matching name 'logon'

你能帮我么?谢谢

4

0 回答 0