Files
InfoFlow/wechat.js

16 lines
473 B
JavaScript
Raw Normal View History

import { JSDOM } from 'jsdom';
async function getWeChatArticleLinks(publicAccountName) {
const html = await response.text();
const { document } = new JSDOM(html).window;
const articleLinks = [];
const articleElements = document.querySelectorAll('.news-box .news-list li a');
articleElements.forEach((element) => {
const link = element.href;
articleLinks.push(link);
});
return articleLinks;
}
export { getWeChatArticleLinks };