Python module--requests <http Access Module >

Source: Internet
Author: User

URLLIB2 is a good HTTP access library, but the design of the API is too rational, resulting in human use of this organism will encounter a variety of complex headaches.

Requests's witty and interesting introduction is as follows:

Requests is the only non-GMO Python HTTP Library that humans can enjoy safely.

warning : Non-professional use of other HTTP libraries can lead to dangerous side effects, including: security defects, redundant code, Reinventing wheel disease, chewing on documents, depression, headaches, and even death.

Requests Chinese documents

A simple example of a requests module

Import= requests.get ('http://www.bing.com')#  The text of the HTML document after transcoding response_text = response.text#  The original text of the HTML document (bytes object)Response_text = Response.content

This is just the tip of the iceberg of this module, powerful but not complex, is indeed a good design module, so want to go deeper, documentation and practice is the quickest way.

* requests + BeautifulSoup work together is refreshing, if you are also in for HTTP access and HTML parsing headache or annoyance, may wish to look at these two modules of the documentation, there will be a lot of gains.

Python module--requests

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.