此 Meteor 代码使用“puppeteer 8.0.0”、“puppeteer-core 10.0.0”、puppeteer-extra 3.1.18”和“puppeteer-extra-plugin-stealth 2.7.8”,它给出以下错误:
错误:无法在本地找到所需的浏览器(chrome)。运行
npm install以下载正确的 Chromium 修订版 (884014)。
尝试“npm install”无济于事。在线阅读,尝试从 package.json 依赖项中删除 "puppeteer-core": "^10.0.0" 但无济于事。
非常感谢任何帮助。谢谢
const puppeteer = require('puppeteer-extra');
const nameH = require('./NameH');
const puppeteerOptions = {
headless: true,
ignoreHTTPSErrors: true,
args: ['--no-sandbox', '--single-process', '--no-zygote', '--disable-setuid-sandbox']
}
let browser;
let pageNameH;
const init = async () => {
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
console.log('1') //>>>>>>>>>>>> Prints 1
puppeteer.use(StealthPlugin());
console.log('2') //>>>>>>>>>>>> Prints 2
browser = await puppeteer.launch(puppeteerOptions);
console.log('3') //>>>>>>>>> DID NOT PRINT <<<<<<<<<<<<<<<
pageNameH = …Run Code Online (Sandbox Code Playgroud) 安装正确的软件包后出现上述错误
Python --版本
Python 3.6.9
安装命令
pip3 安装 httpx
点 3 列表
anyio (3.6.1)
async-generator (1.10)
Brotli (1.0.9)
certifi (2022.6.15)
charset-normalizer (2.1.0)
contextvars (2.4)
dataclasses (0.8)
dnspython (2.2.1)
email-validator (1.2.1)
h11 (0.12.0)
httpcore (0.14.7)
httpx (0.22.0)
idna (3.3)
immutables (0.18)
MarkupSafe (2.0.1)
pip (9.0.1)
pkg-resources (0.0.0)
pydantic (1.9.1)
python-dateutil (2.8.2)
rfc3986 (1.5.0)
setuptools (39.0.1)
six (1.16.0)
sniffio (1.2.0)
typing-extensions (4.1.1)
validator (0.7.1)
Run Code Online (Sandbox Code Playgroud)
在虚拟环境交互式 shell 中,该包也可以正常工作
(env) PEOPLE\saurabhkamble@lp7948:/var/www/vip_select_shaadi_api$ uvicorn main:app --reload
INFO: Will watch for changes in these directories: ['/var/www/vip_select_shaadi_api']
INFO: …Run Code Online (Sandbox Code Playgroud)