Iterates over all badges pages of a steam profile
            Parses all badges (using parse_badge()) to return the appId, play time ('till now) and the number of card drops left.

            @param appid_filter only look for appids listed here

def parse_badges_pages(self, appid_filter=None):
        ''' Iterates over all badges pages of a steam profile
            Parses all badges (using parse_badge()) to return the appId, play time ('till now) and the number of card drops left.

            @param appid_filter only look for appids listed here
        '''
        appid_filter = appid_filter or []
        filter_appids = True if appid_filter else False
        parsed_apps = {}
        currentPage = badgePages = 1

        retry = False
        while currentPage <= badgePages and (filter_appids == False or len(appid_filter) > 0):
            r = self.swb.get('https://steamcommunity.com/my/badges', params={'p': currentPage})
            if r.status_code == 302:
                if retry:
                    # We already tries to force a login
                    raise Exception('Unable to fetch badges')
                # Looks like we've been redirected. Force a login and retry
                print('Need to login again')
                self.swb.login()
                retry = True
                continue

            soup = BeautifulSoup(r.content, 'html.parser')
            if currentPage == 1:
                try:
                    badgePages = int(soup.find_all('a', {'class': 'pagelink'})[-1].get_text())
                except:
                    pass

            for b in soup.find_all('div', {'class': 'badge_title_stats'}):
                try:
                    app = self.parse_badge(b)
                except PageParserError:
                    # Could not correctly parse app info, continue with the next one
                    continue

                # AppId's where given as filter, check if this AppId is one of those
                if filter_appids:
                    if app.appid in appid_filter:
                        appid_filter.remove(app.appid)
                    else:
                        # This appid is NOT in the filter list.
                        # don't include it in the returned list
                        continue

                # Add app info to the list of parsed badges
                parsed_apps[app.appid] = app

                if filter_appids and len(appid_filter) == 0:
                    # AppId's where given as filter and all of them where found already
                    # so we are done.
                    break
            # Continue with next page
            currentPage += 1

        if not parsed_apps:
            #FIXME: empty badges page == no good.
            print('ERRPOR: Could not find any badges on badge page')
            from tempfile import NamedTemporaryFile
            tmpf = NamedTemporaryFile(prefix='quickDump_', suffix='.html', delete=False)
            print('Dumping r.content to: "file://%s"' % tmpf.name)
            tmpf.write(r.content)
            tmpf.close()
            rname = tmpf.name.replace('.html', '.dat')
            with open(rname, 'w') as tmpf:
                print('Dumping r to: "file://%s"' % rname)
                tmpf.write(vars(r))

        return parsed_apps