lenOfPage = driver.execute_script(
    'window.scrollTo(0, document.body.scrollHeight);var lenOfPage=document.body.scrollHeight;return lenOfPage;'
    )
if lastCount == lenOfPage:
    match = True
How to scroll to the end of the page using selenium in python