Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Selenium page scrolling operation

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

/ / move to the "top" of the element element object to align with the "top" of the current window

Driver.execute_script ("arguments [0] .scrollIntoView ();", element)

Driver.execute_script ("arguments [0] .scrollIntoView (true);", element)

/ / move to the bottom of the element element object to align with the bottom of the current window

Driver.execute_script ("arguments [0] .scrollIntoView (false);", element)

/ / move to the bottom of the page

Driver.execute_script ("window.scrollTo (0, document.body.scrollHeight)")

/ / move to the specified coordinates (relative to the current coordinates)

Driver.execute_script ("window.scrollBy (0700)")

/ / move to the absolute position coordinates of the window, as follows, move to the vertical coordinate position of 1600 pixels

Driver.execute_script ("window.scrollTo (0, 1600)")

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report