Skip to content

Is there a way to scroll down on a page until a certain element pops up ? #2367

Answered by mdmintz
elnatan2604 asked this question in Q&A
Discussion options

You must be logged in to vote

There are several scroll methods that you can work with:

self.scroll_to(selector, by="css selector", timeout=None)
# Duplicates: self.scroll_to_element(selector, by="css selector")

self.slow_scroll_to(selector, by="css selector", timeout=None)
# Duplicates: self.slow_scroll_to_element(selector, by="css selector")

self.scroll_into_view(selector, by="css selector", timeout=None)

self.scroll_to_top()

self.scroll_to_bottom()

If the element that you want to interact with is already in the html, (but not visible yet), then you can use self.js_click(selector) to click on the hidden element. If that's not enough, you can create a loop where you call one of the scroll methods and then check fo…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@iamumairayub
Comment options

@mdmintz
Comment options

@elnatan2604
Comment options

@mdmintz
Comment options

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants