enter image description here
I am trying to match a variable; in this case “Days_in_advance” where the output is the current date + 7 days, i.g. the 10th day of the month.
Am looking to match this “Days_in_advance” value with, text() to find the exact matching element and subsequently click on it.
Currently have something like this, highlighted row in screenshot is the value I’d like to match.
days_in_advance = date.today() + datetime.timedelta(days = 7)
formatted_date = days_in_advance.strftime(“%d”)datepick = driver.find_element(By.XPATH, “//*[contains(text(), formatted_date)]”)
datepick.click()
I know this is wrong but I’m pretty new to this so I appreciate the help. Thanks!
Tomtgol96 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.