最有可能的是,您有一个可滚动(div)元素,您可以将其作为参数(可滚动)传递给下面的函数。public static void scrollDownByPixAmount(IWebElement scrollable, int pixelsToScroll){ //assuming your driver var is a static member of same class (driver as IJavaScriptExecutor).ExecuteScript($"arguments[0].scrollTop = {pixelsToScroll};", scrollable);}注意:上面的代码片段未编译。