Here is what I am looking for.
s = Session()
s.get(url, callback=self.do_this)
def do_this(self, response):
print response.url
Here is what I am looking for.
s = Session()
s.get(url, callback=self.do_this)
def do_this(self, response):
print response.url
You can use event hooks:
def display_url(r, **kwargs):
print(r.url)
s = Session()
s.hooks['response'].append(display_url)
s.get(...)
Documentation here: https://requests.kennethreitz.org/en/master/user/advanced/#event-hooks
Use grequests to have asynchronous requests with gevent. There is a callback
keyword argument to .get()
.