Scroll up and down to get Element into View with Selenium Python

后端 未结 6 1620
梦毁少年i
梦毁少年i 2021-01-05 19:10

I need to be able to scroll up and after that down to find some element with Selenium.
I already saw many questions and answers, the main idea I found is self.web_

6条回答
  •  失恋的感觉
    2021-01-05 19:54

    I have discovered a handy tricky hacky stuff over the years (I've been using Selenium for 150 years).

    Whenever you're unable to scroll up a form, just send keys into an input on the top of the page. The driver will find it and will automagically scroll up the page to perform the action.

    Whenever I think about this trick, I realize being an old man isn't that bad.

    Good luck you fresh sailor, see you on the shores of Selenia.

提交回复
热议问题