Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

scrolling down all filter menu linkedin with selenium

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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);")
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading