Skip to content

Instantly share code, notes, and snippets.

@autrilla
Created May 8, 2015 11:31
Show Gist options
  • Select an option

  • Save autrilla/116c6f6762ccf267ff8d to your computer and use it in GitHub Desktop.

Select an option

Save autrilla/116c6f6762ccf267ff8d to your computer and use it in GitHub Desktop.
import scrapy
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors import LinkExtractor
class StoreSpider(CrawlSpider):
name = 'store'
allowed_domains =['tiendaganadera.com', 'tiendaagricola.com']
start_urls = ['http://tiendaganadera.com/home.php',
'http://tiendaagricola.com/home.php']
rules = (
Rule(LinkExtractor(), callback='parse', follow=True),
Rule(LinkExtractor(), callback='parse'),
)
def parse(self, response):
self.log('Parsing ' + response.url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment