First, Introduction
Requests is a Python HTTP client library, similar to URLLIB,URLLIB2, but the advantage of requests is that the use of simple, same functionality, with requests implementation of the code is much less. After all, the official documents are very straightforward to say:
Python's standard library URLLIB2 provides most of the HTTP functionality needed, but the API is too counter-trivial, and a simple function requires a lot of code.
Therefore, the use of requests more convenient.
Second, download the installation
Note: Students who are not configured with a Python development environment can poke the configuration Python development environment first
1, first go here requests library download Download installation package
Download with git: Git clone https://github.com/kennethreitz/requests
and unzip it into the Python installation directory.
2. Then open the cmd command line, use the command "CD (requests-master Path)" or the selected Requests-master, hold down SHIFT right-click to open the CMD fast channel, such as:
3. Then enter the command: Python setup.py install, enter
4. Check whether the installation is successful
Open cmd command line, enter: Python enter
Then enter: Import requests
Appears for installation success
It is recommended that you use the Python requests library to crawl Petal pictures of the program: Python crawler: Crawl petals net picture, is practiced hand.
python--installing requests third-party libraries