Python 如果我没有';在《刮痧》中爬行蜘蛛的t亚类

Python 如果我没有';在《刮痧》中爬行蜘蛛的t亚类,python,django,scrapy,Python,Django,Scrapy,这是我的代码,我的蜘蛛没有跟随链接 我有来自InitSpider的子类 class TestSpider(InitSpider): name = 'login' allowed_domains = ['example.com'] start_urls = ['http://www.example.com'] rules = (Rule(SgmlLinkExtractor(allow=('example\.com', 'PostSearch'),restrict_x

这是我的代码,我的蜘蛛没有跟随链接 我有来自InitSpider的子类

class TestSpider(InitSpider):
    name = 'login'
    allowed_domains = ['example.com']
    start_urls = ['http://www.example.com']
    rules = (Rule(SgmlLinkExtractor(allow=('example\.com', 'PostSearch'),restrict_xpaths = "//dd[@class='nextPage']"), callback='parse_items', follow=True),)

    def parse_items(self, response):

        hxs = HtmlXPathSelector(response)
  • 我用这个例子*

您有没有收到任何错误?我没有收到任何错误,但除了开始url外,它没有跟随任何链接。给定您正在爬网的网站以及如何运行爬网
scrapy crawl someurl
?它可以是任何网站,你能给我一个简单的例子吗?你在哪里从
initSpider
创建子类,它跟随链接。如果我从爬行蜘蛛子类,那么它的工作很好。我正在用糠秕虫爬亚马逊