new method with ability to control consumption

This commit is contained in:
Vostretsov Nikita 2018-04-23 10:45:14 +00:00
parent da1256a9c8
commit bc41d31377
1 changed files with 7 additions and 0 deletions

View File

@ -82,6 +82,13 @@ class Spider(object_ref):
for url in self.start_urls:
yield Request(url, dont_filter=True)
def start_requests_with_control(self):
for r in self.start_requests():
yield r
if r is not None:
yield None
def make_requests_from_url(self, url):
""" This method is deprecated. """
return Request(url, dont_filter=True)