How can I fix requests.exceptions.HTTPError: 404 Client Error: Not Found for google_trans_new?
I am getting the error below when trying to translate a text with google_trans_new
in Python:
Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/googletransnew/googletransnew.py", line 189, in translate r.raiseforstatus() File "/usr/lib/python3/dist-packages/requests/models.py", line 943, in raiseforstatus raise HTTPError(httperrormsg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https:// translate .google .cn/_/TranslateWebserverUi/data/batchexecute
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "test.py", line 9, in <module> translation = translator.translate(text, langtgt=targetlanguage) File "/usr/local/lib/python3.10/dist-packages/googletransnew/googletransnew.py", line 194, in translate raise googlenewtransError(tts=self, response=r) googletransnew.googletransnew.googlenewtransError: 404 (Not Found) from TTS API. Probable cause: Unknown