How to add a GET parameter to a URL in Python

Adding a GET parameter to a URL adds a query of one or more variables to the end of a URL. Making a request with a GET parameter added to it returns a queried Response object.

Solution for How to add a GET parameter to a URL in Python : You can use requests.get() and string concatenation to add a GET paramter to a URL Use the syntax “?variable=value” to make a GET parameter where variable equals value . Use the syntax url += parameter to add the previous result parameter to the URL url. Call requests.get(url) to make a GET request to the previous result url with the GET parameter.

Insert & between expressions to add more than one GET parameter to the URL.

url = "http://httpbin.org/anything"


how-to-add-a-get-parameter-to-a-url-in-python