Last active
March 16, 2019 23:01
-
-
Save dogweather/dcb286b1a49ba8bc2366aa3da3d421a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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