I'm using Selenium on python and I would like to scroll to an element to click on it. Everywhere I see that the rigth things to do to go directly to the element is to use :
driver = webdriver.Chrome()
driver.get(url)
element = driver.find_elements_by_class_name('dg-button')
driver.execute_script("return arguments[0].scrollIntoView();", element)
But I have this error : "javascript error: arguments[0].scrollIntoView is not a function".
What to I do wrong ? Thanks