0

I am trying to scrape a website using playwright and host it on Azure Functions. However, playwright requires Chrome drivers which I can't seem to install into Azure Functions.

Unsure how to do this step in a pipeline:

pip install playwright
playwright install

Previously, I tried to do it in an azure pipeline:

  - 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'

However, I get a webkit" browser was not found.Please complete Playwright installation via running"python -m playwright install
It seems like the Azure Function is not finding where it was installed. Any suggestions? Would using Docker be a good tactic?

Tujamo
  • 93
  • 8

1 Answers1

0

Looks like azure functions support headless chromium with consumption based app service plan.

Here is the blog to know more about the running headless chromium in azure functions with playwright

over this github issue ,it was suggested to use the azure functions on docker container

please file a support ticket and MS Q&A here

VenkateshDodda
  • 4,723
  • 1
  • 3
  • 12
  • Thank you for your answer. However, I would be looking to use it in Python which there doesn't seem to a be a solution for. Either way, I created my own custom docker image and installed all the necessary dependencies in there. – Tujamo Aug 25 '21 at 13:39