Hi
I am writing a bot for one site.When i have gone through the html it contains 4-5
js file which are creating the cookies by various complex ways.Now i need to those cookies to post in to next request but i am not getting those.Even google analytics
js put some cookies which are not visible also.The only way i can see those are by fiddler and paros but not getting in HTTPResponse's cookies.I have used JScriptCodeProvider but it is of no use because it takes syntax diffrent than javascript and i can not make it for thousands of lines.Actually i need to post image to that site.My Code is.....
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(loginURL);
httpWebRequest.Method = "Get";
httpWebRequest.KeepAlive = true;
httpWebRequest.AllowAutoRedirect = true;
httpWebRequest.Accept = @"image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
httpWebRequest.Headers.Add("Accept-Encoding", "gzip, deflate"); //lets try accepting gzip
httpWebRequest.Headers.Add("UA-CPU", "x86");
httpWebRequest.Headers.Add("Accept-Language", "en-us");
httpWebRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; Zune 2.0; .NET CLR 3.0.04506.648)";
httpWebRequest.CookieContainer = new CookieContainer();
HttpWebResponse webResponse = (HttpWebResponse)httpWebRequest.GetResponse();
//webResponse.ContentEncoding = "Unicode";
Stream responseStream = webResponse.GetResponseStream();
if (webResponse.ContentEncoding.ToLower().Contains("g zip"))
responseStream = new GZipStream(responseStream, CompressionMode.Decompress);
else if (webResponse.ContentEncoding.ToLower().Contains("d eflate"))
responseStream = new DeflateStream(responseStream, CompressionMode.Decompress);
Encoding encoding=Encoding.GetEncoding("utf-8");
//string links = hu.Process(responseStream,new Uri(loginURL));
StreamReader responseReader = new StreamReader(responseStream, encoding);
string responseString = responseReader.ReadToEnd();
webResponse.Cookies.Add(httpWebRequest.CookieConta iner.GetCookies(httpWebRequest.RequestUri));
Please help me regarding the issue..
Thanks in advance!
Abhishek