genre_explorer/genres/genres_scraper.py
def _get_list_of_genre_from_links():
    """
    Returns the list of genres from the given list of links
    :params links - list
    """
    links = _get_links_to_sections_of_genres()
    g = []
    for i in links:
        wiki_genres_page = requests.get(i)
        try:
            wiki_genres_page.raise_for_status
        except Exception as exc:
            print("There was a problem")
        wiki_genres_page = wiki_genres_page.text
        bs_obj = bs4.BeautifulSoup(wiki_genres_page, "html.parser")
        for div in bs_obj.findAll("div", {"class": "navbox"}):
            div.decompose()
        bs_obj.p.decompose()
        
        tmp1 = bs_obj.select(".mw-content-ltr ul li")
        for i in tmp1:
            g.append(str(i.next_element.next_element))
        
        del g[len(g)-1]
        
    return g

    Returns the list of genres from the given list of links
    :params links - list
    
Returns the list of genres from the given list of links
:params links - list
Returns the list of genres from the given list of links : params links - list
def _get_list_of_genre_from_links():
    links = _get_links_to_sections_of_genres()
    g = []
    for i in links:
        wiki_genres_page = requests.get(i)
        try:
            wiki_genres_page.raise_for_status
        except Exception as exc:
            print("There was a problem")
        wiki_genres_page = wiki_genres_page.text
        bs_obj = bs4.BeautifulSoup(wiki_genres_page, "html.parser")
        for div in bs_obj.findAll("div", {"class": "navbox"}):
            div.decompose()
        bs_obj.p.decompose()
        tmp1 = bs_obj.select(".mw-content-ltr ul li")
        for i in tmp1:
            g.append(str(i.next_element.next_element))
        del g[len(g)-1]
    return g
def _get_list_of_genre_from_links ( ) : links = _get_links_to_sections_of_genres ( ) g = [ ] for i in links : wiki_genres_page = requests . get ( i ) try : wiki_genres_page . raise_for_status except Exception as exc : print ( "There was a problem" ) wiki_genres_page = wiki_genres_page . text bs_obj = bs4 . BeautifulSoup ( wiki_genres_page , "html.parser" ) for div in bs_obj . findAll ( "div" , { "class" : "navbox" } ) : div . decompose ( ) bs_obj . p . decompose ( ) tmp1 = bs_obj . select ( ".mw-content-ltr ul li" ) for i in tmp1 : g . append ( str ( i . next_element . next_element ) ) del g [ len ( g ) - 1 ] return g
Returns the list of genres from the given list of links
:params links - list
Returns the list of genres from the given list of links : params links - list
"""
    Returns the list of genres from the given list of links
    :params links - list
    """