Nowy kurs! Każdy programista powinien nauczyć się Generative AI!
Wypróbuj darmową lekcję0
Scroll to bottom of page in Selenium with browser minimized
I’m doing an automation task with selenium via Python, and I need the browser minimized while it runs, but I have encountered a problem where the ActionsChain scroll_by_amount doesn’t seem to work at all. It runs without error but does nothing when the browser is minimized. I need to scroll to the bottom of the page. If I try to scroll to the footer element itself, it says it’s out of bounds because it’s somehow wider than the webpage, even though it could be vertically scrolled to.
5 odpowiedzi
+ 1
TYJ, I found a solution: driver.find_element(By.TAG_NAME, “html”).send_keys(Keys.END)
+ 4
Your code?
In general element must be identified beforehand.
+ 2
This is not a mistake but a limitation.
+ 1
JaScript
driver.minimize_window()
ActionChains(driver).scroll_by_amount(0, any_integer).perform() #Does nothing once browser is minimized
I think it may be a bug in Selenium, but since I’m new to the library I’m not certain.
0
JaScript What a shame. You can scroll to elements but not by amount?