Skip to content

Instantly share code, notes, and snippets.

@nramirezuy
Created August 18, 2014 17:42
Show Gist options
  • Save nramirezuy/e05171a559d1b99caf66 to your computer and use it in GitHub Desktop.
Save nramirezuy/e05171a559d1b99caf66 to your computer and use it in GitHub Desktop.
from scrapy.spider import Spider
class SeveralNamesSpider(Spider):
def start_requests(self):
print 'name: {}, start_urls: {}'.format(self.name, self.start_urls)
for name, start_urls in (('name1', ('url1', )), ('name2', ('url2', ))):
globals()[name] = type(name, (SeveralNamesSpider, ), {'name': name, 'start_urls': start_urls})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment