def _get_html(url, timeout=settings.CRAWLER_FETCH_TIMEOUT,
        sleep=settings.CRAWLER_RETRY_SLEEP,
        retries=settings.CRAWLER_RETRY_COUNT):
    while retries > 0:
        html = _download_html(url, timeout=timeout)

        if html == '' or parser.is_limit_exceeded(html):
            rs = settings.CRAWLER_RETRY_COUNT - retries + 1

            if rs > settings.CRAWLER_RETRY_WARNING:
                level = logging.WARNING
            else:
                level = logging.DEBUG

            log.log(level, ('Limit exceeded, retrying download: {0}/{1} ({2}'
                ' sleep)\nurl: {3}').format(
                rs, settings.CRAWLER_RETRY_COUNT, sleep, url))
            gevent.sleep(sleep)
            retries -= 1
        else:
            return html
    else:
        log.warning('Downloader retry limit exceeded. Either the limit '
            'is too small, some unknown bug was encountered or there is a '
            'connection error.')
dataset/ETHPy150Open ipeirotis/Mturk-Tracker/app/mturk/main/management/commands/crawler/tasks.py/_get_html/original