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.7.tar.gz
(11.3 kB
view details)
Built Distribution
seletrans-0.4.7-py3-none-any.whl
(14.9 kB
view details)
File details
Details for the file seletrans-0.4.7.tar.gz
.
File metadata
- Download URL: seletrans-0.4.7.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.8 Linux/5.15.78-1-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52437f3dbd38928ceb8494d737a89c4accfa8b9b3c431664e6f05c9f24f5a662 |
|
MD5 | 22312dae8b0b244d3f9170e8f4e337ae |
|
BLAKE2b-256 | e70ae77e81c70ef9981e8378015e52702dcfd0d6d5bb5cfb395501ad878dd763 |
File details
Details for the file seletrans-0.4.7-py3-none-any.whl
.
File metadata
- Download URL: seletrans-0.4.7-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.8 Linux/5.15.78-1-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c066a65b3257e8f3d331af26f805e7dd2cabbb05d0e2121ed8ae126f1a847ca1 |
|
MD5 | 5cb8cadcaaf53b9bbe504ca012ba887b |
|
BLAKE2b-256 | 4ed745f1dc14ea587842f5087ead6b4b8670c66d631016a5f53fd277a338108e |