print('---------------------------------') #for x1,y1 in enumerate(data_.find_all('url')): for x,y in enumerate(data_.find_all('loc')): print(x,y.string) list_url.append(y.string)
for x2,y2 in enumerate(data_.find_all('lastmod')): startTime=y2.string startTime=dateutil.parser.parse(startTime) date1=(startTime.isoformat())[0:10] startTime=date1+" "+(startTime.isoformat())[11:19] startTime=datetime.datetime.strptime(startTime,"%Y-%m-%d %H:%M:%S") now=datetime.datetime.utcnow() endTime = datetime.datetime(now.year, now.month, now.day, now.hour, now.minute, now.second) date2=(endTime.isoformat())[0:10] date = endTime- startTime seconds=date.seconds if date1==date2 and seconds<600:#Can be modified list_date.append(x2)