📜  如何在 scrapy 蜘蛛中传递用户定义的参数 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:11.498000             🧑  作者: Mango

代码示例1
class VisualScrapySpider(scrapy.Spider):
    name = 'visualscrapy'

    def __init__(self, category='', **kwargs):
        self.start_urls = [f'http://www.visualscrapy.com/search?query={category}']
        super().__init__(**kwargs)

#scrapy crawl visualscrapy -a category=