Compare commits

..

2 Commits

Author SHA1 Message Date
Benjamin Loison
7cffb7e37a
Make connection more reliable 2024-04-03 19:52:08 +02:00
Benjamin Loison
0e871cf913
Assume that actual entries are prefered by Linguee 2024-04-02 10:51:07 +02:00

View File

@ -30,7 +30,12 @@ def treatSuffixes(prefix):
print('From file')
except:
params['qe'] = base
text = requests.get(url, params = params).text
while True:
try:
text = requests.get(url, params = params).text
break
except requests.exceptions.ConnectionError:
continue
# Pay attention if change `base` elaboration to not allow unwanted folder file writing.
with open(baseFilePath, 'w') as requestFile:
requestFile.write(text)
@ -49,6 +54,8 @@ def treatSuffixes(prefix):
entries.add(entry)
if not base in entry:
interestingEntries = False
else:
interestingEntries = False
if rowsLen == MAXIMUM_SUGGESTIONS and interestingEntries:
treatSuffixes(base)