code: def get_piis_for_date(query_str, date):
      
      count = 200
      params = {'query': query_str,
                'count': count,
                'start': 0,
                'sort': '-coverdate',
                'date': date,
                'field': 'pii'}
      all_piis = []
      while True:
          res = requests.get(elsevier_search_url, params, headers=ELSEVIER_KEYS)
          if not res.status_code == 200:
              logger.info('Got status code: %d' % res.status_code)
              break
          res_json = res.json()
          entries = res_json['search-results']['entry']
          logger.info(res_json['search-results']['opensearch:totalResults'])
          if entries == [{'@_fa': 'true', 'error': 'Result set was empty'}]:
              logger.info('Search result was empty')
              return []
          piis = [entry['pii'] for entry in entries]
          all_piis += piis
          # Get next batch
          links = res_json['search-results'].get('link', [])
          cont = False
          for link in links:
              if link.get('@ref') == 'next':
                  logger.info('Found link to next batch of results.')
                  params['start'] += count
                  cont = True
                  break
          if not cont:
              break
      return all_piis
docs: Search ScienceDirect with a query string constrained to a given year.
  
      Parameters
      ----------
      query_str : str
          The query string to search with
      date : str
          The year to constrain the search to
  
      Returns
      -------
      piis : list[str]
          The list of PIIs identifying the papers returned by the search