If you look at the XPath in the error message, you will probably see what the issue is. Your text isn’t surrounded by quotes as is required, e.g.

td[@area-label=November 2025]

should be

td[@area-label="November 2025"]

To fix this, you need to adjust your line of code to

dp_month = driver.find_element_by_xpath('//*/td[@aria-label="'+month_label+'"]/div[contains(text(),"'+ x_month +'")]')

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top