【发布时间】:2014-02-06 01:17:50
【问题描述】:
我正在尝试登录 this page。
br = mechanize.Browser(factory=mechanize.RobustFactory())
br.set_cookiejar(cj)
current_page = br.open(LOGIN_URL)
soup = BeautifulSoup(current_page.get_data())
current_page.set_data(soup.prettify())
br.set_response(current_page)
print soup.findAll('form')
assert br.viewing_html()
for f in br.forms():
print f.name
但即使 BeautifulSoup 完美地找到表单,它也会为表单打印 None 。有人有什么想法吗?
【问题讨论】:
标签: python html beautifulsoup mechanize