import scrapy
class NordstromSpider(scrapy.Spider):
name = "nordstrom"
start_urls = [
'http://shop.nordstrom.com/c/womens-dresses-new?origin=leftnav&cm_sp=Top%20Navigation-_-New%20Arrivals'
]
def parse(self, response):
for dress in response.css('article.npr-product-module'):
yield {
'src': dress.css('img.product-photo').xpath('@src').extract_first(),
'url': dress.css('a.product-photo-href').xpath('@href').extract_first()
}
def noparse(self, response):
page = response.url.split("/")[-2]
filename = 'nordstrom-%s.html' % page
with open(filename, 'wb') as f:
f.write(response.body)
self.log('Saved file %s' % filename)
import scrapy
class QuotesSpider(scrapy.Spider):
name = "rtr"
start_urls = [
'https://www.renttherunway.com/products/dress'
]
def parse(self, response):
for dress in response.css('div.cycle-image-0'):
yield {
'image-url': dress.xpath('.//img/@src').extract_first(),
}