driver.execute_script('history.go') javaS = "window.location = 'https://www.tutorialspoint.com/index.htm'" driver. execute_script(javaS)
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')