fix(route): fix zhihu/posts title (#10672)

This commit is contained in:
Neko Aria
2022-09-01 22:42:11 +08:00
committed by GitHub
parent a921d68201
commit 135cbfffea
+2 -1
View File
@@ -18,7 +18,8 @@ module.exports = async (ctx) => {
const data = response.data;
const $ = cheerio.load(data);
const jsondata = $('#js-initialData');
const authorname = $('.ProfileHeader-name').text();
const authorname = $('.ProfileHeader-name').contents()
.filter((_index, element) => element.type === 'text').text();
const authordescription = $('.ProfileHeader-headline').text();
const parsed = JSON.parse(jsondata.html());