コード例 #1
0
    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&page=trang-%d.html' % (self.domain, channel, page)
        else:
            url = '%s%s' % (self.domain, channel)

        response = Request().get(url)
        return Channel().get(response)
コード例 #2
0
 def search(self, text, page=1):
     url = "%s/tim-kiem/%s.html" % (self.domain, urllib.quote_plus(text))
     response = Request().get(url)
     return Channel().get(response)
コード例 #3
0
 def getCategory(self):
     url = "%s/%s" % (self.domain, 'danh-sach/')
     response = Request().get(url)
     return Category().get(response), Channel().get(response)
コード例 #4
0
 def search(self, text):
     # http://phimbathu.org/tim-kiem/(keywords).html
     url = "%s/tim-kiem/%s.html" % (self.domain, urllib.quote_plus(text))
     response = Request().get(url)
     return Channel().get(response, 1)