Home > Mobile >  Unable to extract Product images using Scrapy
Unable to extract Product images using Scrapy

Time:07-15

I want to extract product images using scrapy from this link

https://bbdealz.com/product/1000pcs-jigsaw-puzzle-7550cm-with-storage-bag-wooden-paper-puzzles-educational-toys-for-children-bedroom-decoration-stickers/

Here is my code

'img': response.css('figure.woocommerce-product-gallery__image a::attr("href")').getall(),

But it return empty. How to get all the images with comma seprated using scrapy ?

CodePudding user response:

you can try using xpath[contains()]

I have tested that this works:

response.xpath("//div[contains(@class,'woocommerce-product-gallery__image')]/a/@href").getall()
  • Related