fix: facebook pages not working (#4501)

This commit is contained in:
Xunco
2020-04-21 19:46:23 +08:00
committed by GitHub
parent 4f2ace0e8e
commit 16041e7aa3
+3 -2
View File
@@ -80,9 +80,10 @@ module.exports = async (ctx) => {
const html = await fetchPageHtml(linkPath, pageId, ctx.cache);
const $ = cheerio.load(html);
const itemLinks = $('div[role=article] > div:nth-child(2) > div:nth-child(2)')
const itemLinks = $('footer > div:nth-child(2) > a:nth-child(1)')
.toArray()
.map((div) => $(div).find('a').last().attr('href'));
.map((a) => $(a).attr('href'));
const items = await Promise.all(
itemLinks.map(async (itemLink) => {
if (new RegExp(`^/.+/photos/`).test(itemLink)) {