Amn*_*had 12 node.js puppeteer
我的代码如下:
const browser = await puppeteer.launch({headless: params["headless"]});
const page = await browser.newPage();
await page.setJavaScriptEnabled(true);
await page.setRequestInterception(true);
...
Run Code Online (Sandbox Code Playgroud)
问题是我无法运行它。我收到以下异常。
(node:7008) UnhandledPromiseRejectionWarning: Error: Could not find browser revision 756035. Run "npm install" or "yarn install" to download a browser binary.
at ChromeLauncher.launch (C:\Users\rpaadmin\.jenkins\workspace\ikinciyeni\generic_scrapper\node_modules\puppeteer\lib\Launcher.js:59:23)
at async browse (C:\Users\rpaadmin\.jenkins\workspace\ikinciyeni\generic_scrapper\main_2.0_temp.js:126:19)
at async tryExecute (C:\Users\rpaadmin\.jenkins\workspace\ikinciyeni\generic_scrapper\main_2.0_temp.js:73:5)
at async sequentialFor (C:\Users\rpaadmin\.jenkins\workspace\ikinciyeni\generic_scrapper\main_2.0_temp.js:416:5)
at async tryExecute (C:\Users\rpaadmin\.jenkins\workspace\ikinciyeni\generic_scrapper\main_2.0_temp.js:60:5)
at async sequentialFor (C:\Users\rpaadmin\.jenkins\workspace\ikinciyeni\generic_scrapper\main_2.0_temp.js:416:5)
at async tryExecute (C:\Users\rpaadmin\.jenkins\workspace\ikinciyeni\generic_scrapper\main_2.0_temp.js:60:5)
at async httpBlock (C:\Users\rpaadmin\.jenkins\workspace\ikinciyeni\generic_scrapper\main_2.0_temp.js:268:5)
at async tryExecute (C:\Users\rpaadmin\.jenkins\workspace\ikinciyeni\generic_scrapper\main_2.0_temp.js:64:5)
at async sequentialFor (C:\Users\rpaadmin\.jenkins\workspace\ikinciyeni\generic_scrapper\main_2.0_temp.js:416:5)
(node:7008) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
Run Code Online (Sandbox Code Playgroud)
我如何解决它 ?它之前工作得很好。
| 归档时间: |
|
| 查看次数: |
11224 次 |
| 最近记录: |