【发布时间】:2021-08-24 20:31:44
【问题描述】:
我正在尝试使用 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 会是个好策略吗?
【问题讨论】:
标签: docker azure-functions cloud playwright-python