Os explico lo que estoy haciendo y lo que quiero hacer, estoy obteniendo la información de una página pero ésta carga las imágenes por javasccript, para conseguirlas hago un post al server para que me devuelva el trozo de html que las contiene. Por alguna razón que se me escapa de mi comprensiónno consigo recojer el link correctamente mediante Xpath, este "html" que me devuelve el servidor:
<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>
Estos son todos los Xpath que e utilizado pero ninguno con el resultado deseado:
print response.xpath('//a/@href') #no coje todo el link
print "-------------------------------------------"
print response.xpath('//img') #no coje todo el link
print "-------------------------------------------"
print response.xpath('//img[@class=vc_gitem-zone-img]') #vacio
print "-------------------------------------------"
print response.xpath('//*[@class=vc_gitem-zone-img]') #vacio
print "-------------------------------------------"
print response.xpath('//@href') #no coje todo el link
print "-------------------------------------------"
print response.xpath('//@src') #no coje todo el link
print "-------------------------------------------"
print response.xpath('normalize-space(//a/@href)') #no coje todo el link
print "-------------------------------------------"
print response.xpath('//*[@class=vc_gitem-zone-img]/@src') #vacio
El último que e usado es este:
response.xpath('//a/@href')
Y en consola me devuelve el link a medias como los demás:
data=u'http://www.siie.com/wp-content/uploads/2'>
Gracias por vuestro tiempo.