Browse Source

Убирание начальной фразы из риа новостей

master
Alexei 2 years ago
parent
commit
cf918aacfd
  1. 13
      news_parser.js

13
news_parser.js

@ -180,8 +180,8 @@
function GrubTextFunc(a_Element) {
var content = '';
if (a_Element.innerText) {
content = TrimString(a_Element.textContent);
}
content = TrimString(a_Element.textContent);
}
return content;
}
return GrubTextFunc
@ -227,6 +227,13 @@
else if (location.hostname == 'ria.ru') {
let base_element = document.getElementsByClassName('article__header')[0];
var base_element_text = document.getElementsByClassName('article__body')[0];
var tire = ['–', '—', '‒', '―', '⸺', '⸻'];
var clear_text = [];
for (var i in tire) {
var t = tire[i];
clear_text.push(t + ' РИА Новости. ');
}
content = MakeContentByNews(
base_element,
base_element,
@ -235,7 +242,7 @@
'photoview__open',
'article__block',
ElementCheckerRia,
['– РИА Новости. ', '— РИА Новости. ']
clear_text
);
}
else if (location.hostname == 'zakonvremeni.ru') {

Loading…
Cancel
Save