scrapy_dynamic_spiders/factories/crawl_spider_factory.py
def _construct_rule_list(self, spidercls) -> List[Rule]:
        """
        Constructs a list of rules for a new temporary CrawlSpider subclass, based on the factory's attributes and
        the provided template spider class

        :param spidercls: The CrawlSpider class or a CrawlSpider subclass
        :return: a list of Rules
        """
        # construct rules
        if self.rule_ow:
            rules = []
        else:
            rules = copy.deepcopy(spidercls.rules)
            if not rules:
                rules = []

        for i in range(len(self.rule_configs)):
            if not self.extractor_configs:
                rules.append(f_utils.construct_rule({}, self.rule_configs[i]))
            else:
                # handles case where there are fewer extractor configs than rule configs
                try:
                    rules.append(f_utils.construct_rule(self.extractor_configs[i], self.rule_configs[i]))
                except IndexError:
                    rules.append(f_utils.construct_rule(self.extractor_configs[-1], self.rule_configs[i]))

        return rules

        Constructs a list of rules for a new temporary CrawlSpider subclass, based on the factory's attributes and
        the provided template spider class

        :param spidercls: The CrawlSpider class or a CrawlSpider subclass
        :return: a list of Rules
        
Constructs a list of rules for a new temporary CrawlSpider subclass, based on the factory's attributes and
the provided template spider class
Constructs a list of rules for a new temporary CrawlSpider subclass based on the factory ' s attributes and the provided template spider class
def _construct_rule_list(self, spidercls) -> List[Rule]:
        if self.rule_ow:
            rules = []
        else:
            rules = copy.deepcopy(spidercls.rules)
            if not rules:
                rules = []
        for i in range(len(self.rule_configs)):
            if not self.extractor_configs:
                rules.append(f_utils.construct_rule({}, self.rule_configs[i]))
            else:
                try:
                    rules.append(f_utils.construct_rule(self.extractor_configs[i], self.rule_configs[i]))
                except IndexError:
                    rules.append(f_utils.construct_rule(self.extractor_configs[-1], self.rule_configs[i]))
        return rules
def _construct_rule_list ( self , spidercls ) -> List [ Rule ] : if self . rule_ow : rules = [ ] else : rules = copy . deepcopy ( spidercls . rules ) if not rules : rules = [ ] for i in range ( len ( self . rule_configs ) ) : if not self . extractor_configs : rules . append ( f_utils . construct_rule ( { } , self . rule_configs [ i ] ) ) else : try : rules . append ( f_utils . construct_rule ( self . extractor_configs [ i ] , self . rule_configs [ i ] ) ) except IndexError : rules . append ( f_utils . construct_rule ( self . extractor_configs [ - 1 ] , self . rule_configs [ i ] ) ) return rules
Constructs a list of rules for a new temporary CrawlSpider subclass, based on the factory's attributes and
the provided template spider class
Constructs a list of rules for a new temporary CrawlSpider subclass based on the factory ' s attributes and the provided template spider class
"""
        Constructs a list of rules for a new temporary CrawlSpider subclass, based on the factory's attributes and
        the provided template spider class

        :param spidercls: The CrawlSpider class or a CrawlSpider subclass
        :return: a list of Rules
        """ # construct rules # handles case where there are fewer extractor configs than rule configs
a list of Rules
a list of Rules
self
spidercls
The CrawlSpider class or a CrawlSpider subclass
The CrawlSpider class or a CrawlSpider subclass