Small change.
This commit is contained in:
parent
b3e6e75f90
commit
32cb7e80c8
|
@ -25,11 +25,8 @@ module.exports = async (link, id) => {
|
||||||
|
|
||||||
await page.goto(link, { waitUntil: 'load', timeout: 0 });
|
await page.goto(link, { waitUntil: 'load', timeout: 0 });
|
||||||
|
|
||||||
const title = await page.title();
|
|
||||||
await page.screenshot({ path: screenshotDirectory + id + '.png', fullPage: true});
|
await page.screenshot({ path: screenshotDirectory + id + '.png', fullPage: true});
|
||||||
await page.pdf({ path: pdfDirectory + id + '.pdf', format: 'a4' });
|
await page.pdf({ path: pdfDirectory + id + '.pdf', format: 'a4' });
|
||||||
|
|
||||||
await browser.close();
|
await browser.close();
|
||||||
|
|
||||||
return title;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,8 +52,7 @@ app.post('/api', async (req, res) => {
|
||||||
await insertDoc(req.body);
|
await insertDoc(req.body);
|
||||||
|
|
||||||
res.send("DONE!");
|
res.send("DONE!");
|
||||||
|
getData(pageToVisit, req.body._id);
|
||||||
const dataResult = await getData(pageToVisit, req.body._id);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
insertDoc(req.body);
|
insertDoc(req.body);
|
||||||
|
|
Ŝarĝante…
Reference in New Issue