I want to perform infinite scroll down on this page: https://www.financialjuice.com/home
after some scrolls down, a window appear (sign up), and I need to remove it so the scroll down comlete, but I can't, I created this code:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
u = "https://www.financialjuice.com/home"
driver = webdriver.Chrome(executable_path=r"C:\chromedriver.exe")
driver.get(url)
driver.execute_script("window.scrollTo(0, document.body.scrollHeight)")
driver.implicitly_wait(60) # seconds
print('start scrolling')
for i in range(5):
driver.find_element_by_css_selector('html').send_keys(Keys.END)
print("scroll", i)
time.sleep(5)
# the pop up window will appear after the 4th scroll
# the below code to try to click on the page to remove it
el=driver.find_elements_by_xpath('//*[@id="aspnetForm"]/div[3]/header/nav/div[2]/div/div[1]/div/a[1]/img[2]')[0]
action = webdriver.common.action_chains.ActionChains(driver)
# action.move_to_element_with_offset(el, 5, 5)
action.move_to_element_with_offset(el, 5, 0)
action.click()
action.perform()
### after remove it, I complete the scrolls:
for i in range(100):
driver.find_element_by_css_selector('html').send_keys(Keys.END)
print("scroll", i)
time.sleep(1)
I need solution to this pop up so I can scroll down infinitely on this web page