i doin work for scraping data that equal to date.. i need scape data that equal to date in a list….
i try this code but didt works.. but if i use with only single data listdate = 'Jun 30, 2022' works…
listdate = ['Jun 23, 2022', 'Jun 24, 2022', 'Jun 25, 2022']
lp = driver.find_element(By.CSS_SELECTOR, 'div > time')
lpval = lp.get_attribute('title') == (listdate)
print(lpval)
if lpval == True :
print('Do sometin')
else:
print('Stop')
>Solution :
Not sure if I understood correctly, but incase you want to check against all values in list, you can do lp.get_attribute('title') in listdate, which will return True if any of the values in the list match lp.get_attribute('title')