Skip to content

Commit

Permalink
24/11/26 Add foodtalks
Browse files Browse the repository at this point in the history
  • Loading branch information
Geraldxm committed Nov 26, 2024
1 parent fe0abfb commit 0b5ae36
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/routes/foodtalks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,13 @@ async function handler() {

// 导入 puppeteer 工具类并初始化浏览器实例
const browser = await puppeteer();
// 打开一个新标签页
const page = await browser.newPage();
await page.goto(url);
await page.waitForSelector('.news');

const result = await page.evaluate(() => ({
html: document.documentElement.outerHTML,
}));
html: document.documentElement.outerHTML,
}));

const response = result.html;
page.close();
Expand Down

0 comments on commit 0b5ae36

Please sign in to comment.