colorfusion / animelyrics

Python API to grab anime lyrics from https://www.animelyrics.com
MIT License
4 stars 1 forks source link

AttributeError: 'NoneType' object has no attribute 'find' #1

Open DriftAsimov opened 3 years ago

DriftAsimov commented 3 years ago

When I run a piece of code that uses this api, it throws the following error:

File "path\animelyrics\animelyrics.py", line 55, in search_lyrics
    lyrics_table = center_box.find("table")
AttributeError: 'NoneType' object has no attribute 'find'

I am using the following code:

import animelyrics
print(animelyrics.search_lyrics("gurenge", lang="jp"))
saipuneet357 commented 3 years ago

I'm facing the same issue

~/.virtualenvs/cv/lib/python3.8/site-packages/animelyrics/animelyrics.py in search_lyrics(query, lang, show_title)
         center_box = soup.find("div", {"class": "centerbox"})
--->    lyrics_table = center_box.find("table")
          lyrics = "" 
AttributeError: 'NoneType' object has no attribute 'find'

I'm using the code:

import animelyrics
animelyrics.search_lyrics('renai circulation')
DriftAsimov commented 3 years ago

@saipuneet357 You can use this package, it works fine for me -> https://pypi.org/project/animec/