playwright-community / playwright-go

Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
https://playwright-community.github.io/playwright-go/
MIT License
2.19k stars 160 forks source link

[Feature]: Offline deployment cannot specify a local Google Chrome. #482

Open Xiaomajohn opened 2 months ago

Xiaomajohn commented 2 months ago

Offline deployment cannot specify a local Google Chrome.How can i do? this is my code: browser, _ := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{ Channel: playwright.String("chrome"), ExecutablePath: playwright.String("C:\Program Files\Google\Chrome\Application\chrome.exe"), Headless: &head, }) It prompts me that the browser cannot be found.

canstand commented 1 month ago

You don't need ExcutablePath, specify the Channel and let Playwright find it automatically.