I am using Selenium webdriver in Python for a web-scraping project.
I would like to login by entering the login details and then click the submit button.
I am able to enter the Username and Password. But I am not able to mouseclick the submit button.
The “submit” button is of type <input>.
<input type="image" src="/images/buttons/loginnow.gif" tabindex="3">
Here is the python code where I am trying to click the mouse.
submitButton=driver.find_element_by_xpath("//input[@type='image'][@src='/images/buttons/loginnow.gif']")
driver.click(submitButton)
I get the following error :
AttributeError: ‘WebDriver’ object has no attribute ‘click’
Any idea how to fix it or any other alternative solution to login to a website in Python.
Thanks
You need to call the click function of the element, not the driver.