My code below is to get the genre of movies from the IMDB site, however I'm not sure how to get the specific tag of genres from the site, because sometimes instead of catching the genre it gets the keywords tag, get the first div
he thinks.
def get_genero(soup):
genero = soup.find ('div', attrs={'class':'see-more inline canwrap'})
print(genero)
if genero != None:
return [a.text for a in genero.findAll('a')]
else:
return None
Being that I only need to get the genres of IMDB movies. I wanted to know how I can get a specific place using BeautifulSoup.
Link to a sample page from a movie: