import requests url = 'http://httpbin.org' response = requests.get(url) print(response.text) # get content as a string print(response.content) # get content as bytes