When I run a playwright code in C#, it opens up many cmd windows:
This is the code I use:
using (var playwright = await Playwright.CreateAsync())
{
var browser = await playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions() { Headless = true }).ConfigureAwait(false);
var browserPageOptions = new BrowserNewPageOptions() { JavaScriptEnabled = true };
var page = await browser.NewPageAsync(browserPageOptions).ConfigureAwait(false);
await page.GotoAsync(URL).ConfigureAwait(false);
await page.WaitForRequestFinishedAsync();
var SourceCode = await page.ContentAsync().ConfigureAwait(false);
await page.CloseAsync().ConfigureAwait(false);
await browser.CloseAsync().ConfigureAwait(false);
}
I believe you are probably running Playwright v1.31.0
That had a defect in that caused cascading cmd windows to appear. That has been fixed in v1.31.1