3

我想单击/提交一个图像类型的按钮

<input type="image" onclick="javascript:return showhide();" src="IMAGES/login.gif" name="submit">

我尝试了以下

mech = mechanize.Browser(factory=mechanize.RobustFactory())
mech.open(url)
mech.select_form(nr=0)
mech["username"] = options.user
mech["password"] = options.pswd
results = mech.submit().read()

但结果仍然只包含登录页面。如何使用 python mechanize 模拟点击类型为图像的提交。

4

0 回答 0