我正试图使用Mechanize提交关于此page的表单。在
br.open("http://mspc.bii.a-star.edu.sg/tankp/run_depth.html")
#selecting form to fill
br.select_form(nr = 0)
#input for the form
br['pdb_id'] = '1atp'
req = br.submit()
但是,这会产生以下错误
^{pr2}$
我想这是因为一些错误的字符编码(ref)。我想知道怎么解决这个问题。在
Tags:
您的问题是某个损坏的HTML comment tags,导致mechanize的解析器无法读取的无效网站。但是您可以改为use the included BeautifulSoup parser,这在我的例子中有效(python2.7.9,mechanize0.2.5):
相关问题 更多 >
编程相关推荐