C# Selenium - Finding Element On Continuously Growing Page

后端 未结 3 1082
再見小時候
再見小時候 2020-12-20 02:07

I am trying to find a better way to do this than using:

js.ExecuteScript(\"scroll(0, 1300)\");

I have a page where the data can change maki

3条回答
  •  误落风尘
    2020-12-20 02:26

    I am not sure if this will work but you can try getting the max height of your page using something like this:

    Math.max($(document).height(), $(window).height())
    

    Then you can scroll using js.ExecuteScript.

    I'd still use findElement after that to initate the click.

提交回复
热议问题