Skip to content Skip to sidebar Skip to footer

Requests S.get(url,verify = False) Error [Python]

I'm attempting to write a program that grabs data from my password protected gradebook and analyzes it for me because my university's gradebook doesn't automatically calculate aver

Solution 1:

Requests does not support so you need subclass the HTTPAdapter

from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
import ssl

class MyAdapter(HTTPAdapter):
    def init_poolmanager(self, connections, maxsize, block=False):
        self.poolmanager = PoolManager(num_pools=connections,
                                       maxsize=maxsize,
                                       block=block,
                                       ssl_version=ssl.PROTOCOL_TLSv1)


import logging
import requests
import re
url = "https://learn.ou.edu/d2l/m/login"
s = requests.session()
s.mount('https://', MyAdapter())
r = s.get(url,verify = False)

print r.status_code

Gives status code:

200

This is answered here


Post a Comment for "Requests S.get(url,verify = False) Error [Python]"