16 lines
473 B
JavaScript
16 lines
473 B
JavaScript
|
|
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 };
|