Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you recommend some Python HTTP client library? [closed]

I want to use Python to capture info from some websites. I want the HTTP client to meet this conditions:

  1. Supports HTTPS

  2. Will not use too much memory, should not generate a lot of processes or threads.

  3. Has clear documentation and is actively supported


I know that requests, tornado, or the gevent -httpclient can finish my task, but I do not know which is the best? Or is there some other choices?

Or if there is some other choices written in C/c++.

like image 934
Djvu Avatar asked May 10 '12 08:05

Djvu


People also ask

What Python library would you use to serve HTTP requests?

In this article, you will learn about the Python Requests library, which allows you to send HTTP requests in Python.

What is Python HTTP Client?

Python HTTP module defines the classes which provide the client-side of the HTTP and HTTPS protocols. In most of the programs, the HTTP module is not directly used and is clubbed with the urllib module to handle URL connections and interaction with HTTP requests.

What is HTTP Client library?

The HTTP Client library provides a basic API through which HTTP requests can be created and executed from within your model.

What is meant by HTTP Client?

An HTTP Client. An HttpClient can be used to send requests and retrieve their responses. An HttpClient is created through a builder . The builder can be used to configure per-client state, like: the preferred protocol version ( HTTP/1.1 or HTTP/2 ), whether to follow redirects, a proxy, an authenticator, etc.


Video Answer


2 Answers

Use requests. It has the most same API of the various libraries.

like image 158
ThiefMaster Avatar answered Sep 17 '22 15:09

ThiefMaster


Another option is httplib2.

  • simple (and therefore efficient)
  • supports everything one needs and Python 3
  • not on Github
  • few months may pass before next commit (partly because it just works)
like image 43
temoto Avatar answered Sep 17 '22 15:09

temoto