from srtranslator.translators.deepl_scrap import DeeplTranslator
translator = DeeplTranslator(driver=driver)
oo = translator.translate("going to pull the small one for auto completion and a big one for actually", 'en', "zh-Hant")
print(oo)
translator.quit()
Traceback (most recent call last):
File "C:\Users\user\Desktop\Python Project\flask_view\videoToOOXX\srtranslatorTest.py", line 61, in
oo = translator.translate("going to pull the small one for auto completion and a big one for actually", 'en', "zh-Hant")
File "C:\Users\user\Desktop\Python Project\flask_view\venv\lib\site-packages\srtranslator\translators\deepl_scrap.py", line 137, in translate
self._set_destination_language(destination_language)
File "C:\Users\user\Desktop\Python Project\flask_view\venv\lib\site-packages\srtranslator\translators\deepl_scrap.py", line 108, in _set_destination_language
self._set_language(language, "//*[@data-testid='translator-target-lang']")
File "C:\Users\user\Desktop\Python Project\flask_view\venv\lib\site-packages\srtranslator\translators\deepl_scrap.py", line 119, in _set_language
x_path_by_text = f"//button[text()='{self.languages[language]}']"
KeyError: 'zh-Hant'
from srtranslator.translators.deepl_scrap import DeeplTranslator
translator = DeeplTranslator(driver=driver)
oo = translator.translate("going to pull the small one for auto completion and a big one for actually", 'en', "zh-Hant") print(oo)
translator.quit()
Traceback (most recent call last): File "C:\Users\user\Desktop\Python Project\flask_view\videoToOOXX\srtranslatorTest.py", line 61, in
oo = translator.translate("going to pull the small one for auto completion and a big one for actually", 'en', "zh-Hant")
File "C:\Users\user\Desktop\Python Project\flask_view\venv\lib\site-packages\srtranslator\translators\deepl_scrap.py", line 137, in translate
self._set_destination_language(destination_language)
File "C:\Users\user\Desktop\Python Project\flask_view\venv\lib\site-packages\srtranslator\translators\deepl_scrap.py", line 108, in _set_destination_language
self._set_language(language, "//*[@data-testid='translator-target-lang']")
File "C:\Users\user\Desktop\Python Project\flask_view\venv\lib\site-packages\srtranslator\translators\deepl_scrap.py", line 119, in _set_language
x_path_by_text = f"//button[text()='{self.languages[language]}']"
KeyError: 'zh-Hant'
sorry! How can I adjust it?