Scroll to bottom of page in Selenium with browser minimized | Sololearn: Learn to code for FREE!
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.

31st May 2024, 4:26 PM
Wilbur Jaywright
Wilbur Jaywright - avatar
5 odpowiedzi
+ 1
TYJ, I found a solution: driver.find_element(By.TAG_NAME, “html”).send_keys(Keys.END)
31st May 2024, 6:20 PM
Wilbur Jaywright
Wilbur Jaywright - avatar
+ 4
Your code? In general element must be identified beforehand.
31st May 2024, 5:55 PM
JaScript
JaScript - avatar
+ 2
This is not a mistake but a limitation.
31st May 2024, 7:16 PM
JaScript
JaScript - avatar
+ 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.
31st May 2024, 6:21 PM
Wilbur Jaywright
Wilbur Jaywright - avatar
0
JaScript What a shame. You can scroll to elements but not by amount?
31st May 2024, 10:37 PM
Wilbur Jaywright
Wilbur Jaywright - avatar