title: How to check if dates in array are in range Last 365 days from today Python Selenium
body: <p>I have a list of items issued last 365 days, last 90 days, etc.
  I need to check if days are in this range: today - previous 365 days, today - last 90 days.</p>
  <p>I created a method that sorts strings with dates, but I do not know how to check the range from the current day to the last 365 days.</p>
  <p>I want to ensure the dates are correct since I have to check them daily.</p>
  <pre><code>   def sort_date_by_last_365_days(self):
      elements = self.driver.find_elements(By.XPATH, '//span[@class  =&quot;date-content&quot;]')
      empty_list = []
      for e in elements:
          print(e.text)
      for i in elements:
          empty_list.append(i.text)
  
      print(empty_list)
      data = pd.DataFrame({'Date': empty_list})
      print(data)
      data['Date'] = pd.to_datetime(data['Date'])
      data.sort_values(by='Date')
      print(data)
      return FrameworkResult(status=0)
  </code></pre>
  <p>The method gets all dates and sorts dates.</p>