def search(self, params, max_results=None, results=[]):
    '\n        Do a search.\n        '
    sleep(random.randint(0, 1))
    count = (max_results if (max_results and (max_results <= Linkedin._MAX_SEARCH_COUNT)) else Linkedin._MAX_SEARCH_COUNT)
    default_params = {'count': count, 'guides': 'List()', 'origin': 'GLOBAL_SEARCH_HEADER', 'q': 'guided', 'start': len(results)}
    default_params.update(params)
    res = self.client.session.get(f'{self.client.API_BASE_URL}/search/cluster', params=default_params)
    data = res.json()
    total_found = data.get('paging', {}).get('total')
    if ((len(data['elements']) == 0) or ((max_results is not None) and (len(results) >= max_results)) or (total_found is None) or (len(results) >= total_found) or ((max_results is not None) and ((len(results) / max_results) >= Linkedin._MAX_REPEATED_REQUESTS))):
        return results
    results.extend(data['elements'][0]['elements'])
    self.logger.debug(f'results grew: {len(results)}')
    return self.search(params, results=results, max_results=max_results)
Do a search.
def search(self, params, max_results=None, results=[]):
    '\n        \n        '
    sleep(random.randint(0, 1))
    count = (max_results if (max_results and (max_results <= Linkedin._MAX_SEARCH_COUNT)) else Linkedin._MAX_SEARCH_COUNT)
    default_params = {'count': count, 'guides': 'List()', 'origin': 'GLOBAL_SEARCH_HEADER', 'q': 'guided', 'start': len(results)}
    default_params.update(params)
    res = self.client.session.get(f'{self.client.API_BASE_URL}/search/cluster', params=default_params)
    data = res.json()
    total_found = data.get('paging', {}).get('total')
    if ((len(data['elements']) == 0) or ((max_results is not None) and (len(results) >= max_results)) or (total_found is None) or (len(results) >= total_found) or ((max_results is not None) and ((len(results) / max_results) >= Linkedin._MAX_REPEATED_REQUESTS))):
        return results
    results.extend(data['elements'][0]['elements'])
    self.logger.debug(f'results grew: {len(results)}')
    return self.search(params, results=results, max_results=max_results)