Hi,
I am new to cloud functions and writing a python function which uses Playwright (https://playwright.dev/python/docs/intro)
As part of installation process, we need to install required browsers, how can I achieve this step?
I do see following messages in logs but I am not sure how to proceed
Hi @amit0,
You can use a Docker container to install a required browser just like chromium.
using apt-get install chromium
.
or you may change the default of the Playwright browser ex. Google Chrome, Microsoft Edge, etc.
browser = playwright.chromium.launch(channel="chrome")
Reference: https://playwright.dev/python/docs/browsers#chromium
For further help you can contact Google Cloud Support.
Thanks.
Hi Christian,
Trust you are doing good. I am stuck with the same problem. I tried running the following without a docker got an error, is docker the only solution, If I want to ensure these dependencies are pre installed in the environment ?
browser = p.chromium.launch(channel="chrome")
error:
playwright._impl._api_types.Error: Chromium distribution 'chrome' is not found at /opt/google/chrome/chrome
Run "playwright install chrome"
Please do guide me.
Thanks