Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
searx-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
searx-engine
Commits
1088c2a7
Commit
1088c2a7
authored
Dec 01, 2017
by
Adam Tauber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] do not crash if publication date is missing in pubmed engine
parent
801b5a56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
pubmed.py
searx/engines/pubmed.py
+8
-5
No files found.
searx/engines/pubmed.py
View file @
1088c2a7
...
...
@@ -84,15 +84,18 @@ def response(resp):
content
=
content
[
0
:
300
]
+
"..."
# TODO: center snippet on query term
publishedDate
=
datetime
.
strptime
(
entry
.
xpath
(
'.//DateCreated/Year'
)[
0
]
.
text
+
'-'
+
entry
.
xpath
(
'.//DateCreated/Month'
)[
0
]
.
text
+
'-'
+
entry
.
xpath
(
'.//DateCreated/Day'
)[
0
]
.
text
,
'
%
Y-
%
m-
%
d'
)
res_dict
=
{
'url'
:
url
,
'title'
:
title
,
'publishedDate'
:
publishedDate
,
'content'
:
content
}
try
:
publishedDate
=
datetime
.
strptime
(
entry
.
xpath
(
'.//DateCreated/Year'
)[
0
]
.
text
+
'-'
+
entry
.
xpath
(
'.//DateCreated/Month'
)[
0
]
.
text
+
'-'
+
entry
.
xpath
(
'.//DateCreated/Day'
)[
0
]
.
text
,
'
%
Y-
%
m-
%
d'
)
res_dict
[
'publishedDate'
]
=
publishedDate
except
:
pass
results
.
append
(
res_dict
)
return
results
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment