puppeteer-sharp
puppeteer-sharp copied to clipboard
No connection could be made because the target machine actively refused it 127.0.0.1:Port
I have PuppeteerSharp project and I need to save the cookies, so I use the following code:
browser = await Puppeteer.LaunchAsync(new LaunchOptions
{
Headless = true,
UserDataDir = Path.Combine(".", "user-data-dir"),
});
I get error this error:
No connection could be made because the target machine actively refused it 127.0.0.1:PortNumber
But when I set the Headless to false, it run without any problem. When I googled for the error message, most solutions says it about the firewall, so I turned off the firewall but nothing changes.