Introduction and installation of Python's Requests module

Introduction to the Requests module

  In python's standard library, although urllib, utllib2, and httplib are provided, it is more convenient and quicker to use requests for interface testing. As the official said, "let HTTP serve human beings".

  Requests is written in python language based on urllib, using the HTTP library of Apache2 Licensed open source protocol. Requests is more convenient than urllib and can save us a lot of work.

Requests module installation

Installation method one:

Execute pip install requests to install requests online

Installation method two:

Go to https://pypi.org/project/requests/

Download and decompress requests-2.19.1.tar.gz, then use cmd to enter the decompression directory, use the command

Python setup.py install install requests

Installation method three: (recommended simple)

Use the pycharm tool to download and install requests

Download path: Open pycharm——File——Settings——Project: Project Name——Python Interpreter——Click the + sign in the upper left corner——Enter requests——Click Install Package;

The steps are illustrated as follows: Follow steps 1-7

 

Practical case

Optical theory is useless, you have to learn to follow along, and you have to do it yourself, so that you can apply what you have learned to practice. At this time, you can learn from some actual combat cases.

If it is helpful to you, please like and collect it to give the author an encouragement. It is also convenient for you to quickly find it next time.

If you don’t understand, please consult the small card below. The blogger also hopes to learn and progress with like-minded testers

At the right age, choose the right position, and try to give full play to your own advantages.

My road of automated test development is inseparable from the plan of each stage along the way, because I like planning and summarizing,

Test and develop video tutorials, study notes and receive portals! ! !

Guess you like

Origin blog.csdn.net/Liuyanan990830/article/details/130042153