Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
71983304
Commit
71983304
authored
Dec 11, 2015
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] temporaire: on saute les documents n'ayant pas le header attendu
parent
52098144
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
EuropressFileParser.py
parsing/FileParsers/EuropressFileParser.py
+14
-5
No files found.
parsing/FileParsers/EuropressFileParser.py
View file @
71983304
...
...
@@ -74,7 +74,7 @@ class EuropressFileParser(FileParser):
name_xpath
=
"./header/div/span[@class = 'DocPublicationName']"
header_xpath
=
"./header/div/span[@class = 'DocHeader']"
detailed_
header_xpath
=
"./header/div/span[@class = 'DocHeader']"
title_xpath
=
"./header/div[@class='titreArticle']"
text_xpath
=
"./section/div[@class='DocText']//p"
...
...
@@ -127,10 +127,19 @@ class EuropressFileParser(FileParser):
except
:
pass
header
=
html_article
.
xpath
(
header_xpath
)[
0
]
.
text
if
header
is
not
None
:
# Article headers in europress
# -----------------------------
# span de class DocHeader fournissant rubrique et date
get_dated_header
=
html_article
.
xpath
(
detailed_header_xpath
)
# le detailed_header est occasionnellement absent
# => FIX TEMPORAIRE: on skippe le document
if
len
(
get_dated_header
)
==
0
or
get_dated_header
[
0
]
.
text
is
None
:
print
(
"WARNING (document skip) unformatted europress header"
)
continue
else
:
header
=
get_dated_header
[
0
]
.
text
# Article detailed headers in europress
# --------------------------------------
# ex: "Seine-Saint-Denis, lundi 28 janvier 2013, p. 93_T_17"
# ex: "Votre ville, jeudi 6 février 2014"
# ex: "World, Friday, November 13, 2015"
...
...
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