Skip to content

Instantly share code, notes, and snippets.

@dogweather
Last active March 16, 2019 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dogweather/dcb286b1a49ba8bc2366aa3da3d421a5 to your computer and use it in GitHub Desktop.
Save dogweather/dcb286b1a49ba8bc2366aa3da3d421a5 to your computer and use it in GitHub Desktop.
# Create a new Category to hold the scraped info. Also,
# prepare it for holding its brands.
category = items.Category(number="...", name="...", url="...", brands=[])
# Save the category into the tree structure.
self.sports["categories"].append(category)
# Create a request for the Category's page, which
# will list all its Brands.
# Pass the Category Item in the meta dict.
request = scrapy.Request(category["url"], callback=self.parse_category_page)
request.meta["category"] = category
yield request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment