Example #1
0
def fetch_genres(helper: psm.PSMHelper, offset: int = 0):
    soup = fetch_soup('http://www.xiami.com/genre')
    seq = tuple(zip(phyhtml.tags_of_class(soup, 'dt', 'fold'), phyhtml.tags_of_class(soup, 'dd', 'fold')))
    for dt, dd in seq[offset:] if offset > 0 else seq:
        group = parse_genre(soup.url + dt.find('a')['href'])
        for a in dd.find_all('a'):
            item = parse_genre(soup.url + a['href'])
Example #2
0
def fetch_artists(url, func, filter=None):
    soup = fetch_soup(url)
    for tag in phyhtml.tags_of_class(soup, 'p', 'buddy'):
        if not filter or filter(tag):
            func(parse_artist(tag.next['href']))