Get rid of all `⇒' anchors in terms and translations - wr - Translate a term via WordReference.com
HTML hg clone https://bitbucket.org/iamleot/wr
DIR Log
DIR Files
DIR Refs
DIR README
---
DIR changeset 6f14a23066e369e1bf2eecf4942570880f592850
DIR parent 482b50e14e5e3b472c51ec629220710dafa2a02d
HTML Author: Leonardo Taccari <iamleot@gmail.com>
Date: Thu, 28 Nov 2019 16:48:36
Get rid of all `⇒' anchors in terms and translations
Based on a patch by Rocky Hotas, thanks!
Diffstat:
wr.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff -r 482b50e14e5e -r 6f14a23066e3 wr.py
--- a/wr.py Thu Nov 28 14:52:00 2019 +0100
+++ b/wr.py Thu Nov 28 16:48:36 2019 +0100
@@ -145,6 +145,7 @@
if tr.find('td', class_='FrWrd'):
frwrd = tr.find('td', class_='FrWrd')
+ [a.decompose() for a in frwrd.find_all('a', text='⇒')]
t['term'] = frwrd.strong.text.strip()
pos2 = frwrd.find('em', class_='tooltip POS2')
if pos2 and pos2.children and len(list(pos2.children)) > 0:
@@ -156,6 +157,7 @@
if tr.find('td', class_='ToWrd'):
towrd = tr.find('td', class_='ToWrd')
+ [a.decompose() for a in towrd.find_all('a', text='⇒')]
pos2 = towrd.find('em', class_='POS2')
to2 = tr.find('td', class_='To2')
if not t.get('translation_contexts'):