Primero, entrecomilla el nombre de las clases, por eso no obtienes coincidencias al usar la clase. En vez de:
'//img[@class=vc_gitem-zone-img]'
haz:
'//img[@class="vc_gitem-zone-img"]'
Después, no imprimas el selector directamente (instancia de scrapy.selector.unified.SelectorList
posiblemente) usa el método get
(o su alias extract_first
) y getall
(o su alias extract
) sobre cada selector para obtener el texto completo dependiendo de si solo quisieras la primera coincidencia o todas como es este caso.
Para generar un ejemplo reproducible:
import scrapy
html='''\
<style type="text/css">
img.wp-smiley,
img.emoji {
display: inline !important;
border: none !important;
box-shadow: none !important;
height: 1em !important;
width: 1em !important;
margin: 0 .07em !important;
vertical-align: -0.1em !important;
background: none !important;
padding: 0 !important;
}
</style>
<link rel='stylesheet' id='dashicons-css' href='http://www.siie.com/wp-includes/css/dashicons.min.css?ver=4.9.8' type='text/css' media='all' />
<link rel='stylesheet' id='thickbox-css' href='http://www.siie.com/wp-includes/js/thickbox/thickbox.css?ver=4.9.8' type='text/css' media='all' />
<div class="vc_grid vc_row vc_grid-gutter-5px vc_pageable-wrapper vc_hook_hover" data-vc-pageable-content="true">
<div class="vc_pageable-slide-wrapper vc_clearfix" data-vc-grid-content="true">
<div class="vc_grid-item vc_clearfix vc_col-sm-4">
<div class="vc_grid-item-mini vc_clearfix ">
<div class="vc_gitem-animated-block ">
<div class="vc_gitem-zone vc_gitem-zone-a vc-gitem-zone-height-mode-auto vc-gitem-zone-height-mode-auto-1-1 vc_gitem-is-link" style="background-image: url('http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-3-768x1024.jpeg') !important;">
<a href="http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-3-768x1024.jpeg" title="JAGEMBERG 165 – 2 3" data-rel="prettyPhoto[rel--1417719797]" data-vc-gitem-zone="prettyphotoLink" class="vc_gitem-link prettyphoto vc-zone-link vc-prettyphoto-link"></a> <img src="http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-3-768x1024.jpeg" class="vc_gitem-zone-img" alt="">
<div class="vc_gitem-zone-mini">
</div>
</div>
</div>
</div>
<div class="vc_clearfix"></div>
</div>
<div class="vc_grid-item vc_clearfix vc_col-sm-4">
<div class="vc_grid-item-mini vc_clearfix ">
<div class="vc_gitem-animated-block ">
<div class="vc_gitem-zone vc_gitem-zone-a vc-gitem-zone-height-mode-auto vc-gitem-zone-height-mode-auto-1-1 vc_gitem-is-link" style="background-image: url('http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-1-1024x768.jpeg') !important;">
<a href="http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-1-1024x768.jpeg" title="JAGEMBERG 165-2 1" data-rel="prettyPhoto[rel--1417719797]" data-vc-gitem-zone="prettyphotoLink" class="vc_gitem-link prettyphoto vc-zone-link vc-prettyphoto-link"></a> <img src="http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-1-1024x768.jpeg" class="vc_gitem-zone-img" alt="">
<div class="vc_gitem-zone-mini">
</div>
</div>
</div>
</div>
<div class="vc_clearfix"></div>
</div>
<div class="vc_grid-item vc_clearfix vc_col-sm-4">
<div class="vc_grid-item-mini vc_clearfix ">
<div class="vc_gitem-animated-block ">
<div class="vc_gitem-zone vc_gitem-zone-a vc-gitem-zone-height-mode-auto vc-gitem-zone-height-mode-auto-1-1 vc_gitem-is-link" style="background-image: url('http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-2-1024x768.jpeg') !important;">
<a href="http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-2-1024x768.jpeg" title="JAGEMBERG 165-2 2" data-rel="prettyPhoto[rel--1417719797]" data-vc-gitem-zone="prettyphotoLink" class="vc_gitem-link prettyphoto vc-zone-link vc-prettyphoto-link"></a> <img src="http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-2-1024x768.jpeg" class="vc_gitem-zone-img" alt="">
<div class="vc_gitem-zone-mini">
</div>
</div>
</div>
</div>
<div class="vc_clearfix"></div>
</div>
<div class="vc_grid-item vc_clearfix vc_col-sm-4">
<div class="vc_grid-item-mini vc_clearfix ">
<div class="vc_gitem-animated-block ">
<div class="vc_gitem-zone vc_gitem-zone-a vc-gitem-zone-height-mode-auto vc-gitem-zone-height-mode-auto-1-1 vc_gitem-is-link" style="background-image: url('http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-4-1024x768.jpeg') !important;">
<a href="http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-4-1024x768.jpeg" title="JAGEMBERG 165 – 2 4" data-rel="prettyPhoto[rel--1417719797]" data-vc-gitem-zone="prettyphotoLink" class="vc_gitem-link prettyphoto vc-zone-link vc-prettyphoto-link"></a> <img src="http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-4-1024x768.jpeg" class="vc_gitem-zone-img" alt="">
<div class="vc_gitem-zone-mini">
</div>
</div>
</div>
</div>
<div class="vc_clearfix"></div>
</div>
</div>
</div>
'''
response = scrapy.Selector(text=html)
Ahora solo tendrías que hacer lo siguiente:
links = response.xpath('//img[@class="vc_gitem-zone-img"]/@src').getall()
print(links)
Lo que muestra la lista con los links para ese html ejemplo:
['http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-3-768x1024.jpeg',
'http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-1-1024x768.jpeg',
'http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-2-1024x768.jpeg',
'http://www.siie.com/wp-content/uploads/2019/03/JAGEMBERG-165-2-4-1024x768.jpeg']
Obviamente hay más formas de llegar al elemento.