【发布时间】:2023-04-03 11:49:02
【问题描述】:
我正在抓取 Flipcart 网站,我想从网站中提取图片 URL。 This is the link to the website.
import scrapy
from ..items import FlipcartItem
class QuotesSpider(scrapy.Spider):
name='quotes'
start_urls=[
'https://www.flipkart.com/clothing-and-accessories/topwear/pr?sid=clo%2Cash&otracker=categorytree&p%5B%5D=facets.ideal_for%255B%255D%3DMen'
]
def parse(self,response):
items=FlipcartItem()
image_url=response.css('._2r_T1I img::attr(src)').extract()
#product_page_url=response.css('').extract()
items['image_url']=image_url
#items['product_page']=title
yield items
这是我编写的代码,在运行代码时我得到一个空列表。像 image_url ["","",""]。任何人都可以请 建议我哪里出错了?
【问题讨论】:
标签: python web scrapy screen-scraping