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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

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());