Answer the question
In order to leave comments, you need to log in
What kind of cookie data to pass to selenium?
There is a code, I need to go to Instagram using cookies, I unloaded all the cookies using the extension,
it turned out to be a large text file, it has a lot of data (value , id , name, etc.)
this code turned out, I tried to transfer data to cookie 2 name , value but getting an invalid cookie error
private void button1_Click(object sender, EventArgs e)
{
driver = new ChromeDriver();
driver.Manage().Cookies.AddCookie(new Cookie("csrftoken", "dwJXBPBe403WDk1PKE8ndUrEhs8fKzJc"));
driver.Navigate().GoToUrl("https://www.instagram.com");
}
Answer the question
In order to leave comments, you need to log in
First go to the site, then insert cookies
ps: csrf does not apply to the session
driver.Manage().Cookies.AddCookie(new Cookie("sessionid", "48257564335%3AxqVRD0uGeXxIor%3A25"));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question