def listProfiles(self):
    def listProfilesInternal(type, url):
      page = self._fetchPage(url)
      profiles = []
      for profile in page.select('td.profile'):
        name = profile.find('span')
        if not name:
          continue
        parent = profile.parent
        appid = parent.select('td.appid')[0].stripped_strings.next()
        status = parent.select('td.statusXcode')[0].stripped_strings.next()
        profiles.append((name.text, appid, status))
      return profiles

    dev = listProfilesInternal('development', _DEVELOPMENT_PROFILES_URL)
    dist = listProfilesInternal('distribution', _DISTRIBUTION_PROFILES_URL)
    print '%s: %d development, %d distribution' % (
        self.username, len(dev), len(dist))
    for p in dev:
      print '    %-35s %-36s %-7s (development)' % p
    for p in dist:
      print '    %-35s %-36s %-7s (distribution)' % p
dataset/ETHPy150Open viewfinderco/viewfinder/clients/ios/scripts/app-tool.py/DevCenterClient.listProfiles/original