Don't get page with 0 comment

This commit is contained in:
Florent 2012-03-20 14:38:49 +01:00 committed by Romain Bignon
commit 4a5456b152
2 changed files with 5 additions and 3 deletions

View file

@ -133,8 +133,10 @@ class DLFP(BaseBrowser):
def get_hash(self, url):
self.location(url)
myhash = hashlib.md5(lxml.etree.tostring(self.page.document)).hexdigest()
return myhash
if self.page.document.xpath('//entry'):
return hashlib.md5(lxml.etree.tostring(self.page.document)).hexdigest()
else:
return None
def get_content(self, _id):
url, _id = self.parse_id(_id)