I need to scrape a date off of a web page and compare it to todays date and see if the scraped date is within 1 year of today and produce a True of False statement.
I spend about 4 hours yesterday trying to get this to work but kept getting errors from every example I could find on the internet when trying to use them in this implementation.
Eventually I got something that worked without errors but it produced the incorrect result.
Unfortunately I somehow managed to delete that script last night and now I'm back at square zero. Instead of beating my head against the wall can someone inform me of the correct way to do this?
I'm trying to do something like this
contract_end_date = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="lbl_CONTRACT_EXPIRES"]'))).text
(example, contract_end_date = "09/25/2022")
if contract_end_date <= todays_date_plus_1_year:
return True
else:
return False
Much appreciate the help