コード例 #1
0
ファイル: howdoi.py プロジェクト: ssahai/howdoi
def get_result(url):
    try:
        return requests.get(url,
                            headers={
                                'User-Agent': random.choice(USER_AGENTS)
                            },
                            proxies=get_proxies()).text
    except requests.exceptions.SSLError as e:
        print(
            '[ERROR] Encountered an SSL Error. Try using HTTP instead of '
            'HTTPS by setting the environment variable "HOWDOI_DISABLE_SSL".\n'
        )
        raise e
コード例 #2
0
ファイル: howdoi.py プロジェクト: telelvis/howdoi
def get_result(url):
    return requests.get(url, headers={'User-Agent': random.choice(USER_AGENTS)}, proxies=get_proxies()).text
コード例 #3
0
ファイル: howdoi.py プロジェクト: Rhain/howdoi
def get_result(url):
    try:
        return requests.get(url, headers={'User-Agent': random.choice(USER_AGENTS)}, proxies=get_proxies()).text
    except requests.exceptions.SSLError as e:
        print('[ERROR] Encountered an SSL Error. Try using HTTP instead of '
              'HTTPS by setting the environment variable "HOWDOI_DISABLE_SSL".\n')
        raise e
コード例 #4
0
ファイル: howdoi.py プロジェクト: eddie-dunn/howdoi
def get_result(url):
    try:
        return requests.get(url, headers={'User-Agent': random.choice(USER_AGENTS)}, proxies=get_proxies()).text
    except requests.exceptions.SSLError:
        print('[ERROR] Encountered an SSL Error. Try using HTTP instead of '
              'HTTPS by specifying the command line option --no-ssl')