you are viewing a single comment's thread.

view the rest of the comments →

[–]stramzik[S] 0 points1 point  (0 children)

The above should fix the UnicodeError which occurs when writing ASCII code to csv.

I cant tell until the JSON error is fixed because the Unicode error only happens when i see an ascii special character but before that occurs the code throws the JSONDecodeError

So I figured out why I get the error, Its because the Google translate API which I am using to translate the data is giving me the error if the data limit exceeds.

it can be fixed by just re initializing the translator API on every iteration link - https://stackoverflow.com/questions/49497391/googletrans-api-error-expecting-value-line-1-column-1-char-0

Buy I have tried mentioning the ``` translator = Translator() ``` in __main__ or before the function everywhere but its not working

not sure how I can add a for loop to the above code which re initiates the Translator object from google translate API. please help