我正在使用带有修改过的CookieAwareWebClient类的WebClient。
我希望它如何工作:我使用帖子登录,然后转到我发布类别ID的搜索页面,作为回报,我希望它给我列出类别的网站来源。我已经设法在Python上做到这一点并且工作正常,但在C#上我认为我在这里做错了。
ServicePointManager.Expect100Continue = false;
var client = new CookieAwareWebClient();
client.BaseAddress = @"http://site/";
// Logging in...
// This part works fine
var loginData = new NameValueCollection();
loginData.Add("login", "user");
loginData.Add("pass", "pass");
client.UploadValues("http://site/authorize.html", "POST", loginData);
// Searching for items
// Not so sure about this part since cannot read what is given back
var searchData = new NameValueCollection();
searchData.Add("catName", "tables");
client.UploadValues("http://site/search.html", "POST", searchData);