b = driver.find_element_by_xpath("//input[starts-with(@class,'gsc')]") driver.execute_script("arguments.click();", b)
javas = "document.getElementsByName('user-search').click();" driver.execute_script(javas)
Please note, we have used getElementsByName('user-search'). The functions like getElementsByName and getElementsById return an array of matching elements. So for locating the first element, the index is used.
However if we are using getElementById function, we need not use the index since only one matching element is referred there.
userN= driver.find_element_by_id("user-search']") driver.execute_script("arguments.click();", userN)
print driver.execute_script('return document.title')