Skip to content

Tag: python-requests

requests.auth.AuthBase TypeError on call

From the docs at https://docs.python-requests.org/en/master/user/authentication/ I gathered that the __call__ function in my own Auth Class should have the r argument, However when i go to call this class in requests.get(auth=MyClass), I get the error TypeError: __call__() missing 1 required positional argume…

Concurrency for requests

I have a python script and I’m sending post requests to same url with different data(different ids). I have to send requests for each id and check them continuously to see if there is a change. I’m handling it with iterating an “ids” list with for loop and sending request for each id a…

Python requests not redirecting

I’m trying to scrape word definitions, but can’t get python to redirect to the correct page. For example, I’m trying to get the definition for the word ‘agenesia’. When you load that page in a browser with https://www.lexico.com/definition/agenesia, the page which loads is https:…

How to parse a list of dictionaries in Python 3

I’m using python(requests) to query an API. The JSON response is list of dictionaries, like below: I’d like to extract 1 field (Identifier) as a list for further analysis (count, min, max, etc.) but I’m having a hard time figuring out how to do this. Answer Python has a syntax feature called…