How to scroll to a specific element in a dynamically loaded list <ul>? #2804
Answered
by
mdmintz
elnatan2604
asked this question in
Q&A
|
I have an unordered list element with over 50 list items, but only the first 10 are loaded initially. I need to scroll for example to the 45th item when the item isn't loaded at first. for example my XPath is (//ul[@title="test"]//li[@title='45']) but I can't find it since it's not loaded initially. How can I scroll to this item and ensure it's loaded before interacting with it? |
Answered by
mdmintz
May 24, 2024
Replies: 1 comment 3 replies
|
There's a |
3 replies
Answer selected by
mdmintz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's a
seleniumbasemethod:sb.scroll_to_bottom(), which scrolls to the bottom of the page. You might be able to use it in a Python loop so that more elements continue to appear before you reach the element that you want.