mirror of https://github.com/scrapy/scrapy.git
change start_request to return a generator instead of a list, in order
to allow to modify start_urls triggered by spider_opened signal
This commit is contained in:
parent
e521da2e2f
commit
cc7fc33833
|
|
@ -50,10 +50,8 @@ class BaseSpider(object_ref):
|
|||
return self._settings
|
||||
|
||||
def start_requests(self):
|
||||
reqs = []
|
||||
for url in self.start_urls:
|
||||
reqs.extend(arg_to_iter(self.make_requests_from_url(url)))
|
||||
return reqs
|
||||
yield self.make_requests_from_url(url)
|
||||
|
||||
def make_requests_from_url(self, url):
|
||||
return Request(url, dont_filter=True)
|
||||
|
|
|
|||
Loading…
Reference in New Issue