Reword translation pick up - wr - Translate a term via WordReference.com
(HTM) hg clone https://bitbucket.org/iamleot/wr
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) changeset a9ddda00f212ad36066e7963bf29e84b8bc661f1
(DIR) parent 6be4db2221ac1974cb64b04d581277311f6fd2d5
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Sat, 5 Oct 2019 13:06:43
Reword translation pick up
Thanks to Rocky Hotas!
Diffstat:
wr.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff -r 6be4db2221ac -r a9ddda00f212 wr.py
--- a/wr.py Wed Oct 02 15:45:32 2019 +0200
+++ b/wr.py Sat Oct 05 13:06:43 2019 +0200
@@ -108,7 +108,9 @@
type = list(pos2.children)[0].strip()
else:
type = ''
- translation = list(towrd.children)[0].strip()
+ if towrd.find('em', class_='POS2'):
+ towrd.em.clear()
+ translation = towrd.text.strip()
ts.append(
Term(
term=term,