python selenium mouse scroll wheel click

后端 未结 2 1371
渐次进展
渐次进展 2020-12-17 05:15

I have a question about is it possible to simulate a mouse scroll wheel click in python selenium ( when you click on a link a new tab opens in the browser ) or something sim

2条回答
  •  渐次进展
    2020-12-17 06:07

    You need to execute some javascript code.

     browser.execute_script("window.scrollBy(0,500)")
     time.sleep(3)
     browser.execute_script("window.scrollBy(0,500)")
     time.sleep(3)
    

    This command to scroll the mouse down two times.

提交回复
热议问题