def getChannel(self, channel, page=1): channel = channel.replace(self.domain, "") if page > 1: channel = channel.replace('.html/', "/") channel = channel.replace('.html', "/") url = '%s%s%d.html' % (self.domain, channel, page) else: url = '%s%s' % (self.domain, channel) response = Request().get(url) return Channel().get(response)
def search(self, text, page=1): url = "%s/search/%s.html" % (self.domain, urllib.quote_plus(text)) response = Request().get(url) return Channel().get(response)
def getCategory(self): response = Request().get(self.domain) return Category().get(response), Channel().getTop(response)