def entries2pages(entries):
    pages = []
    for pageref, group in itertools.groupby(entries, key=itemgetter("pageref")):
        pages.append(list(group))
    return pages
Group HAR entries into pages by pageref
dataset/ETHPy150Open scrapinghub/splash/splash/har/utils.py/entries2pages