diff --git a/timewarp.py b/timewarp.py index 4edb832..901e782 100644 --- a/timewarp.py +++ b/timewarp.py @@ -32,7 +32,7 @@ class TimeWarper(object): return 0 def _set_upload_date_for_photos(self, pagenum, page, set_to_date): - for i, photo in enumerate(page.getchildren()[0].getchildren()): + for i, photo in enumerate(page.findall('photos/photo'): setdate_response = self.flickr.photos_setDates( photo_id=photo.attrib['id'], date_posted=set_to_date @@ -45,7 +45,7 @@ class TimeWarper(object): i = 1 while True: page = self.flickr.photos_search(**query) - if len(page.getchildren()[0].getchildren()): + if len(page.findall('photos/photo')): yield i, page i += 1 else: