Home > Software design >  scrolling down all filter menu linkedin with selenium
scrolling down all filter menu linkedin with selenium

Time:04-20

i wanted to ask you. How can i scroll down the all filter menu in linkedin. I know how to scroll down a page using

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

but i don't know how to scroll inside a menu

CodePudding user response:

You can use Javascript to scroll an element the same way you scroll the window element:

let elem = document.querySelector('#myelem');

elem.scrollTo(0, elem.scrollHeight);

Which would look something like the following:

driver.execute_script("let elem = document.querySelector('#myelem');elem.scrollTo(0, elem.scrollHeight);")
  • Related