我在Python中使用Selenium webdriver进行网络抓取项目。通过Python中的网络抓取工具登录到网站
我想通过输入登录详细信息登录,然后单击提交按钮。
我可以输入用户名和密码。但我无法用鼠标点击提交按钮。
“提交”按钮的类型为<input>
。
<input type="image" src="/images/buttons/loginnow.gif" tabindex="3">
这里是我试图点击鼠标的python代码。
submitButton=driver.find_element_by_xpath("//input[@type='image'][@src='/images/buttons/loginnow.gif']")
driver.click(submitButton)
我得到以下错误:
AttributeError: 'WebDriver' object has no attribute 'click'
不知道如何解决它或任何其他替代解决方案登录到Python中的网站。
感谢
誓言。这是惊人的真的,事实证明,硒也有'提交()'这工作对我来说 – Kiran
这是更好的是重写你的脚本:P – Blender