CockyGrabber icon indicating copy to clipboard operation
CockyGrabber copied to clipboard

Grabbing cookies doesn't work.

Open ghost opened this issue 3 years ago • 5 comments

I understand what the error means, but the thing is I cannot edit it or fix it since it takes no overloads. Could someone help me ?|

image

ghost avatar Apr 12 '23 15:04 ghost

Just edit the project with your fix and rebuild the dll

MoistCoder avatar Apr 13 '23 16:04 MoistCoder

what

ghost avatar Apr 13 '23 17:04 ghost

The project is open source. Just change the file that does the trouble if you know how to fix it. Then rebuild the project. You will get a .dll file as build output.

MoistCoder avatar Apr 13 '23 18:04 MoistCoder

try this

To fix this, you can add a check to make sure that the cookies exist before trying to look at them. That way, if there are no cookies, you won't get an error.

chrome = new ChromeGrabber();
var Cookies = chrome.GetCookies();

if (!string.IsNullOrEmpty(Cookies))
{
    foreach (var item in Cookies)
    {
        Console.Writeline(item);
    }
} else
{
    Console.WriteLine("No cookies found.");
}


cuciuu avatar Apr 16 '23 00:04 cuciuu

@cuciuu

try this

To fix this, you can add a check to make sure that the cookies exist before trying to look at them. That way, if there are no cookies, you won't get an error.

chrome = new ChromeGrabber();
var Cookies = chrome.GetCookies();

if (!string.IsNullOrEmpty(Cookies))
{
    foreach (var item in Cookies)
    {
        Console.Writeline(item);
    }
} else
{
    Console.WriteLine("No cookies found.");
}

The error seems to occur inside var cookies = chrome.GetCookies();, thus your suggestion would not work at all.

MatthiasHeinz avatar Apr 22 '23 02:04 MatthiasHeinz