Python requests speed up using keep-alive

Yes, there is. Use requests.Session and it will do keep-alive by default. I guess I should include a quick example: import logging import requests logging.basicConfig(level=logging.DEBUG) s = requests.Session() s.get(‘http://httpbin.org/cookies/set/sessioncookie/123456789’) s.get(‘http://httpbin.org/cookies/set/anothercookie/123456789’) r = s.get(“http://httpbin.org/cookies”) print(r.text) You will note that these log message occur INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): httpbin.org DEBUG:requests.packages.urllib3.connectionpool:”GET /cookies/set/sessioncookie/123456789 HTTP/1.1″ 302 223 DEBUG:requests.packages.urllib3.connectionpool:”GET /cookies … Read more