Home > Enterprise >  Scroll to Bottom of Page Not Working (Python Selenium)
Scroll to Bottom of Page Not Working (Python Selenium)

Time:07-05

Why doesn't driver.execute_script("window.scrollTo(0, document.body.scrollHeight)") work on this apple music playlist? That line of code works fine on every other website I visit.

I tried doing action.send_keys_to_element(driver.find_element(By.TAG_NAME, 'html'), Keys.END) to no avail.

How else could I scroll to the bottom of the page?

CodePudding user response:

Try to use any interactable node like below:

driver.find_element(By.CLASS_NAME, 'play-button').send_keys(Keys.END)
  • Related