我正在尝试使用刮伤下载图像,但问题是,我找不到路径来获取该图像url。他们正在使用s3作为他们的图像。这就是为什么如果我输入view(响应),我可以看到空白图库。那么我如何获得路径或图像链接呢?这是网站链接。请看一下站点
发布于 2020-10-20 06:20:43
response.xpath('//meta[@property="og:image"]').extract_first()获得主映像import json
image_json = response.xpath('//*[@type="text/x-magento-init"][contains(text(), "mage/gallery/gallery")]/text()').extract_first().strip()
image_dict = json.loads(image_json)
images_data = image_dict['[data-gallery-role=gallery-placeholder]']['mage/gallery/gallery']['data']
image_urls = [image_data['img'] for image_data in images_data]https://stackoverflow.com/questions/64416702
复制相似问题