mirror of
https://github.com/aykhans/PostScrape.git
synced 2025-04-21 00:07:16 +00:00
images added
This commit is contained in:
parent
67c45e3c70
commit
bc3caf3b51
@ -27,6 +27,8 @@ class ToScrapeCSSSpider(scrapy.Spider):
|
|||||||
yield response.follow(f"https://turbo.az{next_page}", callback=self.parse, headers=self.headers)
|
yield response.follow(f"https://turbo.az{next_page}", callback=self.parse, headers=self.headers)
|
||||||
|
|
||||||
def parse_detail_url(self, r):
|
def parse_detail_url(self, r):
|
||||||
|
images = [r.xpath('//a[@class="product-photos-large"]/@href').get()]
|
||||||
|
images += r.xpath('//div[@class="product-photos"]/div/a/@href').getall()
|
||||||
if r.xpath('//div[@class="shop-container"]'):
|
if r.xpath('//div[@class="shop-container"]'):
|
||||||
avto_salon = True
|
avto_salon = True
|
||||||
phone = r.xpath('//div[@class="shop-contact--phones-list"]//a[@class="shop-contact--phones-number"]/text()').getall()
|
phone = r.xpath('//div[@class="shop-contact--phones-list"]//a[@class="shop-contact--phones-number"]/text()').getall()
|
||||||
@ -90,6 +92,7 @@ class ToScrapeCSSSpider(scrapy.Spider):
|
|||||||
yield {
|
yield {
|
||||||
'url': r.url,
|
'url': r.url,
|
||||||
'avto_salon': avto_salon,
|
'avto_salon': avto_salon,
|
||||||
|
'images': images,
|
||||||
'phone': phone,
|
'phone': phone,
|
||||||
'extra_fields': extra_fields,
|
'extra_fields': extra_fields,
|
||||||
'description': description,
|
'description': description,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user