spacepaste

  1.  
  2. import scrapy
  3. class coniferspider(scrapy.Spider):
  4. name = "conifers"
  5. allowed_domian = ['httpbin.org/ip']
  6. start_urls = ['https://httpbin.org/ip']
  7. def parse(self, response):
  8. filename = response.url.split("/")[-2] + '.html'
  9. with open(filename,'wb') as f:
  10. f.write(response.body)
  11.