def _scrape(self):
        for person in Person.objects.filter(calendar_url__isnull=False):
            qs = parse_qs(urlparse(person.calendar_url).query)
            self._getLogger().info('processing person %s' % person.id)
            if 'src' not in qs:
                self._getLogger().warn('invalid calendar url for person %s: %s' % (person.id, person.calendar_url))
            else:
                calendar_id = qs['src'][0]
                self._getLogger().debug('processing calendar_id: %s' % calendar_id)
                res = self._get_google_cal_page(calendar_id, person.calendar_sync_token)
                self._process_items(person, res['items'])
                while res['nextPageToken'] is not None:
                    self._getLogger().debug('processing next page..')
                    res = self._get_google_cal_page(calendar_id, None, res['nextPageToken'])
                    self._process_items(person, res['items'])
                if res['nextSyncToken'] is None:
                    self._getLogger().error('did not get nextToken!')
                else:
                    person.calendar_sync_token = res['nextSyncToken']
                    person.save()
dataset/ETHPy150Open ofri/Open-Knesset/events/scrapers.py/PersonsEventsScraper._scrape/original