Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import scrapy
from ..items import ImageItem
class ImgSpider(scrapy.spiders.Spider):
name = "img_spider"
start_urls = ["https://rubikscode.net/"]
def parse(self, response):
image = ImageItem()
img_urls = []
for img in response.css(".entry-featured-image-url img::attr(src)").extract():
img_urls.append(img)
image["image_urls"] = img_urls
return image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment