How to crawl an entire website with Scrapy?

后端 未结 2 1162
长发绾君心
长发绾君心 2021-01-31 12:17

I\'m unable to crawl a whole website, Scrapy just crawls at the surface, I want to crawl deeper. Been googling for the last 5-6 hours and no help. My code below:



        
2条回答
  •  忘掉有多难
    2021-01-31 12:42

    Rules short-circuit, meaning that the first rule a link satisfies will be the rule that gets applied, your second Rule (with callback) will not be called.

    Change your rules to this:

    rules = [Rule(SgmlLinkExtractor(), callback='parse_item', follow=True)]
    

提交回复
热议问题