fix(route): china.com military xpath (#13465)
This commit is contained in:
parent
67d4a7ed3f
commit
b5e0223fe2
|
|
@ -7,8 +7,7 @@ module.exports = async (ctx) => {
|
|||
const response = await got(websiteUrl);
|
||||
const data = response.data;
|
||||
const $ = cheerio.load(data);
|
||||
const commonList = $('.listItem');
|
||||
|
||||
const commonList = $('.item_list li');
|
||||
ctx.state.data = {
|
||||
title: '中华网-军事新闻',
|
||||
link: 'https://military.china.com/news/',
|
||||
|
|
@ -18,12 +17,12 @@ module.exports = async (ctx) => {
|
|||
.map((_, item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.find('.tit a').text(),
|
||||
title: item.find('h3.item_title').text(),
|
||||
author: '中华网军事',
|
||||
category: '中华网军事',
|
||||
pubDate: parseDate(item.find('.time').text()),
|
||||
description: item.find('.tag').text(),
|
||||
link: item.find('.tit a').attr('href'),
|
||||
pubDate: parseDate(item.find('em.item_time').text()),
|
||||
description: item.find('.item_source').text(),
|
||||
link: item.find('h3.item_title a').attr('href'),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue