Skip to content

Instantly share code, notes, and snippets.

@domingos86
Created February 20, 2017 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domingos86/4c44da54a91a1a03da19629d28872ab5 to your computer and use it in GitHub Desktop.
Save domingos86/4c44da54a91a1a03da19629d28872ab5 to your computer and use it in GitHub Desktop.
Spider template that loads listing ids
class IdSpider(Spider):
def __init__(self):
self.ids = set()
try:
with open('data/' + self.name + '_ids', 'rb') as f:
for line in f:
self.ids.add(line.strip())
except:
pass
super(Spider, self).__init__()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment