Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kiste
ftfdscrpr
Commits
2ecc8eae
Commit
2ecc8eae
authored
Aug 16, 2018
by
Kiste
Browse files
Fix heise
parent
b53359c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
ftfdscrpr/ftfdscrpr.py
View file @
2ecc8eae
...
...
@@ -119,7 +119,8 @@ def do_feed(url, rules_path, verbose):
soup
=
do_soup
(
soup
,
url_rules
,
url
,
verbose
)
if
not
soup
:
fe
.
content
(
'Error doing the soup!'
)
print
(
'Error doing the soup in
\n
'
+
entry
[
'link'
])
if
verbose
:
print
(
'>>>Error doing the soup!'
)
continue
if
comments
:
for
e
in
comments
:
...
...
@@ -127,7 +128,7 @@ def do_feed(url, rules_path, verbose):
if
verbose
:
print
(
'Appending comments'
)
cleanup_soup
(
soup
,
url_rules
,
verbose
)
fe
.
content
(
str
(
soup
),
type
=
'html'
)
fe
.
content
(
str
(
soup
.
prettify
()
),
type
=
'html'
)
return
fg
...
...
rules.json
View file @
2ecc8eae
...
...
@@ -27,9 +27,30 @@
"article"
:
"article"
,
"next"
:
"a[id='atoc_next']"
},
"https://www.heise.de/((newsticker|foto|security|mac-and-i|ix|make)/meldung|meldung|security/artikel)/.*"
:
{
"https://www.heise.de/(|newsticker/)meldung/.*"
:
{
"article"
:
"article"
,
"decompose"
:
[
"div[class='publish-info']"
,
"h2[class='article__heading']"
,
"div[class='creator-info']"
,
"figure"
,
"script"
,
"noscript"
,
"style"
,
"aside[class='top-ad-container']"
,
"section[class='sidebar']"
,
"div[class*='akwa-ad-container']"
,
"a[name='meldung.newsticker.bottom.zurstartseite']"
,
"aside[class='akwa-ad-container']"
,
"a-paternoster"
,
"a-script"
,
"a-collapse"
,
"div[class*='gallery']"
]
},
"https://www.heise.de/((foto|security|mac-and-i|ix|make)/meldung|(make|security)/artikel)/.*"
:
{
"article"
:
"div[class='article-content']"
,
"comments"
:
"footer[class='
article-
footer']"
,
"comments"
:
"footer[class='
beitrags
footer']"
,
"reformat"
:
[
{
"search"
:
"html?.+=.+"
,
...
...
@@ -53,19 +74,20 @@
"aside[class='a-pvg']"
,
"iframe"
,
"div[class*='a-inline-textbox']"
,
"a-collapse-group[class='article-footer__interaction']"
,
"div[id='share-target']"
,
"div[id='subscribe-target']"
,
"aside[class='topics']"
,
"a[class='article-footer__to-homepage']"
,
"aside[class*='pvg-techdata']"
,
"div[class='article-footer__related-forum']"
"p[class='beitragsfooter_themen_foren']"
,
"div[class='shariff clear']"
,
"a[class='beitragsfooter_permalink']"
,
"a[class='beitragsfooter_printversion']"
,
"aside[class='beitragsfooter-themenseiten']"
],
"next"
:
"a[class='seite_weiter']"
},
"https://www.heise.de/developer/meldung/.*"
:
{
"article"
:
"article"
,
"comments"
:
"div[class='article-footer__content']"
,
"decompose"
:
[
"figure"
,
"div[class='publish-info']"
,
...
...
Write
Preview
Supports
Markdown
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