several fixes and website errors detection

This commit is contained in:
Romain Bignon 2011-08-03 15:16:52 +02:00
commit 0f589ad941
2 changed files with 43 additions and 10 deletions

View file

@ -36,14 +36,11 @@ class HDSBrowser(BaseBrowser):
def iter_stories(self):
self.location('/sexe/histoires-par-date.php')
n = 1
while 1:
while self.page.get_numerous() == n:
count = 0
for count, story in enumerate(self.page.iter_stories()):
yield story
if count < 49:
return
n += 1
self.location('/sexe/histoires-par-date.php?p=%d' % n)
@ -55,7 +52,7 @@ class HDSBrowser(BaseBrowser):
return self.page.get_story()
def get_author(self, name):
self.location(self.buildurl('/fiche.php', auteur=name))
self.location(self.buildurl('/fiche.php', auteur=name.encode('iso-8859-15')))
assert self.is_on_page(AuthorPage)
return self.page.get_author()