2

I have created one simple windows app using c# windows forms and scrapysharp library.I have parsed data without problem. But now I need to parse data from another page which requires login. The problem is I dont know how to save cookies in this simulated browser while using this libray.

CookieCollection cookies = new CookieCollection(); 

Browser.UseDefaultCookiesParser = true; WebPage PageResult = Browser.NavigateToPage(new Uri("blackboard.coursesites.com/")); PageWebForm 

form = PageResult.FindForm("login"); 
form["user_id"] = "test"; 
form["password"] = "test"; 
form.Method = HttpVerb.Post; 
WebPage resultsPage = form.Submit(); 
WebPage page = resultsPage; 

When i submit form with username and password, it does not remember my session

  • Can you provide what research you have done so far about this topic? What code have you tried so far? What were the results? – Kevin Oct 21 '19 at 01:32
  • CookieCollection cookies = new CookieCollection(); Browser.UseDefaultCookiesParser = true; WebPage PageResult = Browser.NavigateToPage(new Uri("https://blackboard.coursesites.com/")); PageWebForm form = PageResult.FindForm("login"); form["user_id"] = "***"; form["password"] = "***"; form.Method = HttpVerb.Post; WebPage resultsPage = form.Submit(); WebPage page = resultsPage; When i submit form with username and password, it does not remember my session – Hekuran Kastrati Oct 24 '19 at 23:46
  • Please add this to your **question post**, not as a comment. – Kevin Oct 25 '19 at 00:34

0 Answers0