How to scroll to a specific element in a dynamically loaded list <ul>? #2804
-
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? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
There's a |
Beta Was this translation helpful? Give feedback.
There's a
seleniumbase
method: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.