puppeteer-sharp icon indicating copy to clipboard operation
puppeteer-sharp copied to clipboard

No connection could be made because the target machine actively refused it 127.0.0.1:Port

Open AhmedShamel opened this issue 2 years ago • 0 comments

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.

AhmedShamel avatar Sep 20 '21 12:09 AhmedShamel