【问题标题】:Extract Woocommerce Product Images via scrapy in one column seprated by comma通过scrapy在以逗号分隔的一列中提取Woocommerce产品图像
【发布时间】:2020-12-17 20:07:30
【问题描述】:
【问题讨论】:
标签:
python
python-3.x
web-scraping
woocommerce
scrapy
【解决方案1】:
试试这个:.getall() 返回一个包含所有结果的列表。
response.css('figure.woocommerce-product-gallery__image a::attr("href")').getall()
输出:
['https://royalprint.pk/wp-content/uploads/2020/12/MaroonSweatshirtWonderWoman.jpg', 'https://royalprint.pk/wp-content/uploads/2020/12/G
reySweatshirtWonderWoman.jpg', 'https://royalprint.pk/wp-content/uploads/2020/12/BlueSweatshirtWonderWoman.jpg', 'https://royalprint.pk/
wp-content/uploads/2020/12/BlackSweatshirtWonderWoman.jpg', 'https://royalprint.pk/wp-content/uploads/2020/12/WhiteSweatshirtWonderWoman
.jpg', 'https://royalprint.pk/wp-content/uploads/2020/12/PinkSweatshirtWonderWoman.jpg']