According to leisurely book to deal with. Finding my version won't work. Just walk the road. Turn away. Instead, it got through. Do not know for Mao. It's going to work. Version: Chrome62,selenium 3.8.0 language: Python 2.7.6 js scroll bar processing: Learn the various ways online JS = "var q=document.body.scrolltop= 100000 "Scroll to the bottom js1 =" var q=document.body.scrolltop=0 "scroll to top from Selenium import webdriverimport timeoptions = Webdriver. Chromeoptions () options.add_argument ("start-maximized") Driver = Webdriver. Chrome (chrome_options=options) driver.get (' https://www.cnblogs.com/yoyoketang/?_wv=1031 ') driver.implicitly_wait (+) Driver.execute_script (JS) time.sleep (2) personally tested, found this way can not scroll to the bottom of the Department (online information, whether the use of the lower version of Chrome's browser caused the problem, It's still a matter of selenium. I will not delve into, can use on behalf of your use case can go down) js = "var q=document.documentelement.scrolltop=100000" scroll to the bottom js = "var q= Document.documentelement.scrolltop=0 "Scroll to top from selenium import webdriverimport timeoptions = Webdriver. Chromeoptions () options.add_argument ("start-maximized") Driver = Webdriver. Chrome (chrome_options=options) driver.get (' https://www.cnblogs.com/yoyoketang/?_wv=1031 ') driver.implicitly_wait (+) Driver.execute_script (JS)Time.sleep (2) Pro test can go to the top. (It is doubtful if the chrome version is 62) use the body in a way that cannot be used to the top and bottom while using documentelement.srolltop can be dragged to the tops and bottoms
JS's processing scroll bar