My code goes into a website, and there is a table where each row has a javascript window that pops up when you click on it
I want my code to iterate and click each row, which would prompt the second window to open, perform some action, and then close this window and move on to the next row.
However my code loops when it closes the first window, it clicks back on the first row again. Never moving on to row #2.
from selenium import webdriver
from bs4 import BeautifulSoup
import pandas as pd
import time
import requests
driver = webdriver.Chrome()
vals=[]
finalz=[]
productlink=[]
driver.get('https://aaaai.planion.com/Web.User/SearchSessions?ACCOUNT=AAAAI&CONF=AM2021&USERPID=PUBLIC&ssoOverride=OFF')
time.sleep(3)
page_source = driver.page_source
soup = BeautifulSoup(page_source,'html.parser')
productlist=soup.find_all('tr',class_='clickdiv')
for item in productlist:
ea = item.find_all('td')
title=ea[0].text
sam=driver.find_element_by_class_name('clickdiv') #opens the window
sam.click()
time.sleep(1)
cl=driver.find_element_by_class_name('XX') #this is the close window button
cl.click()