Scrolling to top of the page in Python using Selenium

后端 未结 6 1375
悲哀的现实
悲哀的现实 2020-11-27 07:30

I\'m having issues with scrolling to the top of the web page when using Python and Selenium.

When the page loads for some reason you are taken to the bottom of the

6条回答
  •  有刺的猬
    2020-11-27 07:44

    Please try this:

    driver.execute_script("document.querySelector('div[role=dialog] ul').parentNode.scrollTop=1e100")
    

提交回复
热议问题