mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-01 14:57:14 +08:00
fix(route): MDPI journal - avoid the replace() 'undefined' error (#10022)
This commit is contained in:
@@ -28,7 +28,11 @@ module.exports = async (ctx) => {
|
||||
const title = $2(item).find('.title-link').text();
|
||||
const link = `${host}${$2(item).find('.title-link').attr('href')}`;
|
||||
const authors = $2(item).find('.authors').find('.inlineblock').text();
|
||||
const doi = $2(item).find('.color-grey-dark').find('a').attr('href').replace('https://doi.org/', '');
|
||||
const doiLink = $2(item).find('.color-grey-dark').find('a').attr('href');
|
||||
let doi = '';
|
||||
if (typeof doiLink !== 'undefined') {
|
||||
doi = doiLink.replace('https://doi.org/', '');
|
||||
}
|
||||
$2(item).find('.abstract-full').find('a').remove();
|
||||
const abstract = $2(item).find('.abstract-full').text().trim();
|
||||
const img = `${host}${$2(item).find('.openpopupgallery').find('img').attr('data-src')}`;
|
||||
|
||||
Reference in New Issue
Block a user