0

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')

1 Answers1

1

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')

Tzane
  • 2,752
  • 1
  • 10
  • 21