lushan88a / google_trans_new

A free and unlimited python API for google translate.
MIT License
393 stars 170 forks source link

AttributeError: 'NoneType' object has no attribute 'strip' #26

Open KurdmanPar opened 3 years ago

KurdmanPar commented 3 years ago

Hi. I used Google Translate. But after a while, I encountered the following error. And translation is not possible. Thank you for your help.

error is : 'NoneType' object has no attribute 'strip'

lushan88a commented 3 years ago

Show your code

------------------ Original ------------------ From: KurdmanPar <notifications@github.com> Date: Sun,Jan 17,2021 2:52 PM To: lushan88a/google_trans_new <google_trans_new@noreply.github.com> Cc: Subscribed <subscribed@noreply.github.com> Subject: Re: [lushan88a/google_trans_new] AttributeError: 'NoneType' object has no attribute 'strip' (#26)

Hi. I used Google Translate. But after a while, I encountered the following error. And translation is not possible. Thank you for your help.

error is : 'NoneType' object has no attribute 'strip'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

IRis0550 commented 2 years ago
test = pd.Series(WeiboData['text_raw'].values)
outcome=[]
translator = google_translator()
for y in range(0,len(test)):
    zh = re.sub('[a-zA-Z]','',test[y])
    text = translator.translate(zh,lang_src='zh-cn',lang_tgt='en')
    outcome.append(text)
    from google_trans_new import google_translator  

I have the same bug.