Closed zydjohnHotmail closed 3 years ago
1) There is ExecutablePath
available as well, in BrowserTypeLaunchOptions
.
2) If you try running something like the following, what does version
tell you:
using System;
using System.Threading.Tasks;
using Microsoft.Playwright;
namespace chromelaunch
{
class Program
{
static async Task Main(string[] args)
{
using (IPlaywright pw = await Playwright.CreateAsync())
{
var b = await pw.Chromium.LaunchAsync(new BrowserTypeLaunchOptions() { Headless = false, Channel = "chrome" });
var context = await b.NewContextAsync();
var page = await context.NewPageAsync();
await page.GotoAsync("chrome://version");
await page.ScreenshotAsync(new PageScreenshotOptions() { Path = "version.png" });
}
}
}
}
This looks like it hasn't had a response. If you're still having trouble, please open a new isssue.
Your question
Hello: I am new to Playwright-DotNet, but I have used Puppeteer-Sharp for some time. In Puppeteer-Sharp, I can launch Puppeteer using specific location of Google Chrome. As the following C# code example:
And launch it like this: await Puppeteer.LaunchAsync(Launch_Option);
Now, for Playwright-DotNet (Version 1.14.0 on Windows 10). I can do this:
But I can’t find any C# code example on how to launch it from Chrome’s execute path. I tried something like this:
But when I run my code, I can see Chromium is launched, not Chrome. Any suggestions? I have to use Chrome, as for some web sites, they play some videos, I want to watch the videos. Thanks,