May-07-2020, 07:38 AM
(May-06-2020, 05:22 PM)Larz60+ Wrote: you will have to extract dates and test each
use calendar function:
>>> import calendar >>> print(calendar.isleap(2020)) True >>> print(calendar.isleap(2019)) False
Appreciate a response. I have no idea what to do with this.
I thought maybe you mean like once I get the date, I run it through a pass fail for leap year or Feb-29 and if it fails then apply something to fix it, but I cannot find anything or everything i've tried isn't working. sorry bu can I get more help please?
sold = container.find('span', class_='s-item__ended-date').text soldd = datetime.strptime(sold, '%b-%d %H:%M') solddd = datetime.strftime(soldd, '%d-%b') Date_sold.append(solddd)And thought ok if I go 'print(calendar.isleap(sold)