简体   繁体   中英

Passing cookies from WebBrowser control to htmlAgilityPack WebClient()

My form has a WebBrowser control on it that the user will use to navigate to and login to a website, I then wish to use the HAP so I can use XPath queries to fetch data. Ordinarily of course, the WebClient() session would attempt a loginless session with the same website, thereby not exposing the data I need. Any suggestions?

using SimpleBrowser;
using System.Net;

var browser = new Browser();
browser.Cookies.Add(new Cookie("Name", "Value", "Path", "Domain"));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM