我正在尝试使用 playwright 抓取一个网站并将其托管在 Azure Functions 上。但是,playwright 需要 Chrome 驱动程序,我似乎无法将其安装到 Azure Functions 中。
不确定如何在管道中执行此步骤:
pip install playwright
playwright install
以前,我尝试在 azure 管道中执行此操作:
- script: |
python -m venv ./azfunc/.python_packages
source ./azfunc/.python_packages/bin/activate
python -m pip install --upgrade pip keyring artifacts-keyring
pip install -r ./azfunc/requirements.txt
python -m playwright install
displayName: 'Install dependencies'
但是,我得到了webkit" browser was not found.Please complete Playwright installation via running"python -m playwright install
Azure Function 似乎没有找到它的安装位置。有什么建议么?使用 Docker 会是一个好策略吗?