Translate phase using selenium.
Project description
SeleTrans
Translate phase using selenium. And you can also play the sound of the phase you are querying.
Currently support Baidu
, DeepL
, Bing
and Google
.
Usage
from seletrans.api import *
with Google() as ts:
res = ts.query("book", target="zh-CN")
print(res.result)
print(res.dict_result)
res.play_sound()
Check the test case for more information, or run it yourself to see the results.
Explain
Why use selenium? Why not use requests?
Although selenium is slower than requests, it is more convenient to adapt when API changes.
Notice
On the mac, you have to run /Applications/Python 3.10/Install Certificates.command
to avoid
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
seletrans-0.4.2.tar.gz
(10.6 kB
view hashes)
Built Distribution
seletrans-0.4.2-py3-none-any.whl
(14.2 kB
view hashes)
Close
Hashes for seletrans-0.4.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a5822211fef0c81254cf2f4f37dea392aeff920b9bf56a20410b4c3b4b2a7c8 |
|
MD5 | a3dad4179da7880f2978440eee20d11a |
|
BLAKE2b-256 | 7c3ce717b6e0bf47f7e6fe3b388d530e3887e97f354a1d9f9cca5c241f4d2328 |