title: Scrapy return Base64 of Image Url after 10 images
body: <p>I am trying to scrap data using scrapy. I have got the textual data as needed.But while i tried to scrap image src its returns me exact url in the start and after some records its return </p>
  
  <blockquote>
    <p>"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="</p>
  </blockquote>
  
  <p>Here is my Spider Code</p>
  
  <pre><code>import scrapy
  class CoinmarketcapSpider(scrapy.Spider):
      name = 'coinmarketcap'
      allowed_domains = ['coinmarketcap.com']
      start_urls = ['https://coinmarketcap.com/2']
      def parse(self, response):
          cointable=response.css('table#currencies').xpath('//tbody/tr')
          for coins in cointable:
              name=coins.css('a.currency-name-container::text').extract_first().strip()
              logo=coins.css('img.logo-sprite::attr(src)').extract()
              symbol=coins.css('span.currency-symbol').xpath('.//a/text()').extract_first().strip()
              market_cap=coins.css('.market-cap').xpath('text()').extract_first().strip()
              yield {
                  'Name':name,
                  'image_urls':logo,
                  'symbol':symbol,
                  'market_cap':market_cap
              }
          print response
  </code></pre>
  
  <p>Here the output json file which have ImgLogo url </p>
  
  <blockquote>
    <p>[ {"coinName": ["Bitcoin"], "symbol": ["BTC"], "imgLogo":
    ["<a href="https://s2.coinmarketcap.com/static/img/coins/16x16/1.png" rel="nofollow noreferrer">https://s2.coinmarketcap.com/static/img/coins/16x16/1.png</a>"]},
    {"coinName": ["Ethereum"], "symbol": ["ETH"], "imgLogo":
    ["<a href="https://s2.coinmarketcap.com/static/img/coins/16x16/1027.png" rel="nofollow noreferrer">https://s2.coinmarketcap.com/static/img/coins/16x16/1027.png</a>"]},
    {"coinName": ["XRP"], "symbol": ["XRP"], "imgLogo":
    ["<a href="https://s2.coinmarketcap.com/static/img/coins/16x16/52.png" rel="nofollow noreferrer">https://s2.coinmarketcap.com/static/img/coins/16x16/52.png</a>"]},
    {"coinName": ["Bitcoin Cash"], "symbol": ["BCH"], "imgLogo":
    ["<a href="https://s2.coinmarketcap.com/static/img/coins/16x16/1831.png" rel="nofollow noreferrer">https://s2.coinmarketcap.com/static/img/coins/16x16/1831.png</a>"]},
    {"coinName": ["EOS"], "symbol": ["EOS"], "imgLogo":
    ["<a href="https://s2.coinmarketcap.com/static/img/coins/16x16/1765.png" rel="nofollow noreferrer">https://s2.coinmarketcap.com/static/img/coins/16x16/1765.png</a>"]},
    {"coinName": ["Stellar"], "symbol": ["XLM"], "imgLogo":
    ["<a href="https://s2.coinmarketcap.com/static/img/coins/16x16/512.png" rel="nofollow noreferrer">https://s2.coinmarketcap.com/static/img/coins/16x16/512.png</a>"]},
    {"coinName": ["Litecoin"], "symbol": ["LTC"], "imgLogo":
    ["<a href="https://s2.coinmarketcap.com/static/img/coins/16x16/2.png" rel="nofollow noreferrer">https://s2.coinmarketcap.com/static/img/coins/16x16/2.png</a>"]},
    {"coinName": ["Tether"], "symbol": ["USDT"], "imgLogo":
    ["<a href="https://s2.coinmarketcap.com/static/img/coins/16x16/825.png" rel="nofollow noreferrer">https://s2.coinmarketcap.com/static/img/coins/16x16/825.png</a>"]},
    {"coinName": ["Cardano"], "symbol": ["ADA"], "imgLogo":
    ["<a href="https://s2.coinmarketcap.com/static/img/coins/16x16/2010.png" rel="nofollow noreferrer">https://s2.coinmarketcap.com/static/img/coins/16x16/2010.png</a>"]},
    {"coinName": ["Monero"], "symbol": ["XMR"], "imgLogo":
    ["<a href="https://s2.coinmarketcap.com/static/img/coins/16x16/328.png" rel="nofollow noreferrer">https://s2.coinmarketcap.com/static/img/coins/16x16/328.png</a>"]},
    {"coinName": ["IOTA"], "symbol": ["MIOTA"], "imgLogo":
    ["data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="]},
    {"coinName": ["TRON"], "symbol": ["TRX"], "imgLogo":
    ["data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="]},
    {"coinName": ["Dash"], "symbol": ["DASH"], "imgLogo":
    ["data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="]}]</p>
  </blockquote>
  
  <p>Here is my Items.py code</p>
  
  <pre><code>import scrapy
  class CmindexItem(scrapy.Item):
      # define the fields for your item here like:
       image_urls = scrapy.Field()
  </code></pre>
  
  <p>Here is my piplines.py code that download images and save them in my images directory</p>
  
  <pre><code>import scrapy
  from scrapy.pipelines.images import ImagesPipeline
  from scrapy.exceptions import DropItem
  
  
  class CmindexPipeline(ImagesPipeline):
      def get_media_requests(self, item, info):
          for image_url in item['image_urls']:
              yield scrapy.Request(image_url)
  
      def item_completed(self, results, item, info):
          image_paths = [x['path'] for ok, x in results if ok]
          if not image_paths:
              raise DropItem("Item contains no images")
          item['image_paths'] = image_paths
          return item
  </code></pre>
  
  <p>Here is my settings.py code </p>
  
  <pre><code>BOT_NAME = 'cmindex'
  
  SPIDER_MODULES = ['cmindex.spiders']
  NEWSPIDER_MODULE = 'cmindex.spiders'
  USER_AGENT = 'cmindex (+http://www.cmindex.com)'
  # Obey robots.txt rules
  ROBOTSTXT_OBEY = True
  ITEM_PIPELINES = {'cmindex.pipelines.CmindexPipeline': 1}
  IMAGES_STORE ='E:\WorkPlace\cmindex\cmindex\img'
  DOWNLOADER_MIDDLEWARES = {
      'scrapy.downloadermiddlewares.useragent.UserAgentMiddleware': None,
      'scrapy_fake_useragent.middleware.RandomUserAgentMiddleware': 400,
  }
  </code></pre>
  
  <p>I had added fake user agents and also had added delay in the requests but it didn't affect my end result. So if anyone have idea please share. Thanks </p>