def get_page(page):
    proxy_status = False
    sleep_time = 1
    while (proxy_status == False):
        time.sleep(sleep_time)
        logging.info(('Set proxy: %s' % proxies['http']))
        r = get_request(page=page, proxies=proxies)
        if (r.status_code == 200):
            proxy_status = True
            logging.info(('Proxy UP: %s ' % proxies['http']))
        else:
            logging.info(('Proxy DOWN: %s ' % proxies['http']))
            global proxies
            proxies = {'http': choice(list(open('proxy.txt'))).strip('\n')}
    return r.text
def get_page(page):
    proxy_status = False
    sleep_time = 1
    while (proxy_status == False):
        time.sleep(sleep_time)
        logging.info(('Set proxy: %s' % proxies['http']))
        r = get_request(page=page, proxies=proxies)
        if (r.status_code == 200):
            proxy_status = True
            logging.info(('Proxy UP: %s ' % proxies['http']))
        else:
            logging.info(('Proxy DOWN: %s ' % proxies['http']))
            global proxies
            proxies = {'http': choice(list(open('proxy.txt'))).strip('\n')}
    return r.text