If you intend to save certain sites and explicit requests, simply write the r.url value to a text file. Here is the basic idea:
import requests url = "http://example.com/" r = requests.get(url) afile = open("/path/to/filename.txt", "a") afile.write(r.url) afile.write("\n") afile.close()
Note. If you do this with a POST request and include the authentication data, then secret data (auth keys, passwords, etc.) can be stored in the file.
source share