cleaner way to iterate

This commit is contained in:
smurail 2014-10-23 12:50:15 +02:00
commit 56e9d53adb

View file

@ -31,8 +31,8 @@ class AccountsList(Page):
pass pass
def get_list(self): def get_list(self):
for div in self.document.getiterator('div'): blocks = self.document.xpath('//div[@id="synthese-list"]//div[@class="block"]')
if div.attrib.get('id', '') == 'synthese-list': for div in blocks:
for tr in div.getiterator('tr'): for tr in div.getiterator('tr'):
account = Account() account = Account()
account.id = None account.id = None