diff options
author | Markus Heiser <markus.heiser@darmarIT.de> | 2020-04-20 12:44:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-20 12:44:50 +0000 |
commit | 9302d1fc170a7d2c09fba8c34a75edc8f8652c9a (patch) | |
tree | 9c952ada2c5510f0838d018250d1cb5197d77935 /searx/engines | |
parent | 3a26093c46469a320c2dfa4d732634a462c8f0f4 (diff) | |
parent | 0b7e7acf741a97ae47f809956614df1ea45326e4 (diff) | |
download | searxng-9302d1fc170a7d2c09fba8c34a75edc8f8652c9a.tar.gz searxng-9302d1fc170a7d2c09fba8c34a75edc8f8652c9a.zip |
Merge branch 'master' into master
Diffstat (limited to 'searx/engines')
-rw-r--r-- | searx/engines/startpage.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py index 76567396f..953734934 100644 --- a/searx/engines/startpage.py +++ b/searx/engines/startpage.py @@ -99,11 +99,14 @@ def response(resp): if re.match(r"^([1-9]|[1-2][0-9]|3[0-1]) [A-Z][a-z]{2} [0-9]{4} \.\.\. ", content): date_pos = content.find('...') + 4 date_string = content[0:date_pos - 5] - published_date = parser.parse(date_string, dayfirst=True) - # fix content string content = content[date_pos:] + try: + published_date = parser.parse(date_string, dayfirst=True) + except ValueError: + pass + # check if search result starts with something like: "5 days ago ... " elif re.match(r"^[0-9]+ days? ago \.\.\. ", content): date_pos = content.find('...') + 4 |