Created
February 28, 2014 06:38
-
-
Save nyov/9266443 to your computer and use it in GitHub Desktop.
scrapy ranged start_requests from generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MySpider(Spider): | |
# [...] | |
# start requests from generator | |
def start_requests(self): | |
url = 'http://some.page.tld/%s/category' | |
for page in xrange(1, 247): | |
link = url % page | |
yield Request(url=link) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment