Skip to content
Advertisement

How to scroll at the end of a page with finite number of load ? Selenium – Python

I would like to scroll until the end of a page like : https://fr.finance.yahoo.com/quote/GM/history?period1=1290038400&period2=1612742400&interval=1d&filter=history&frequency=1d&includeAdjustedClose=true

The fact is using this :

JavaScript

does not work. yes it should work for pages with infinite loads but doesn’t work for yahoo finance, which has a finite number of loads but the condition should break when it reachs the end. So I’m quite confuse at the moment.

We could also use :

JavaScript

but it sometimes blocks at a certain loads.

What would be the best way to do this ?

Advertisement

Answer

Requires pip install undetected-chromedriver, but will get the job done. It’s just my webdriver of choice, you can also do the exact same with normal selenium.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement