you can execute JavaScript from selenium using the JavaScript Executor.
The Syntax
driver.execute_script("your javascript code here;")
Examples
Scroll to the bottom of the page
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
Scroll to a specific element
element = driver.find_element(By.ID, "username")
driver.execute_script("arguments[0].scrollIntoView();", element)