0

这是我的代码,我的蜘蛛没有关注我有 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)
4

0 回答 0