How to make a GET request in Python
• 1 minOne of the simplest way to make a GET request in Python is with the requests library.
First we need to install the requests library using the pip python package manager
You can write this in your terminal, it will automatically install the requests library.
pip3 install requests
Getting JSON data
Then we can run this script which will make an HTTP GET request against the website "https://reqbin.com/echo/get/json" that should return
The JSON dict is now accessible from response.json()
Getting HTML data
You could also perform an HTTP GET call against a standard website to retrieve its HTML. Let's try with https://quotes.toscrape.com/
You could try to parse the resulting HTML in order to extract data or save the page as is in an .html file.
Here you are! You can now query any website using requests.