Last active
December 17, 2015 15:09
-
-
Save amferraz/5629475 to your computer and use it in GitHub Desktop.
A simple spider with a custom start url
This file contains hidden or 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 CustomSpider(BaseSpider): | |
def __init__(self, start_url=None, **kwargs): | |
super(BaseSpider, self).__init__(*args, **kwargs) | |
if start_url: | |
self.start_url = start_url | |
def start_requests(self): | |
return [Request(self.start_url)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment