class LimitedLinkExtractor(SgmlLinkExtractor):

    def __init__(self, allow=(), deny=(), allow_domains=(), deny_domains=(),
        restrict_xpaths=(), tags=('a', 'area'), attrs='href', canonicalize=
        True, unique=True, process_value=None, deny_extensions=None,
        max_pages=20):
        pass
How to limit number of followed pages per site in Python Scrapy