Quote:
Originally Posted by Buckyx
thanks all for reply, I found a way to do that using Html Agility Pack
Code:
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
doc.LoadHtml(l_Response);
doc.DocumentNode.SelectSingleNode("...") - depends on what I need
I can basically do anything I think of, just need to set up timers and some conditions so it can be automated because I now use buttons for everythings just to check if it works
other thing I have problem with: I recieve reponse string and its somehow f-ed up so in webBrowser it seems very weird even when I decode HTML tags .. need to say I started working with C# few days ago for first time and havent made any code for few months :D
|
I don't know what kind of f*cked up you mean, but the first thing I would check is if your response is compressed.
You can check this by checking if the response contains a "Content-Encoding" header that is set to some kind of compression method.
The most common compression method I guess is Gzip (at least I had never a different compression method).
Luckily the HttpWebRequest class can automatically decompress your content if you set the
[Only registered and activated users can see links. Click Here To Register...] properly.
You should examine if your target website compresses its responses (you can use Fiddler or Live Http Headers for this).
If it uses compression you can get the used algorithm from the recorded requests and responses.
Then you just set the AutomaticDecompression property:
Code:
request.AutomaticDecompression = DecompressionMethods.Gzip; // If Gzip is used.
request.AutomaticDecompression = DecompressionMethods.Deflate; // If Deflate is used.
request.AutomaticDecompression = DecompressionMethods.Gzip | Decompressionmethods.Deflate; // If both could be used.
If it is not a compression related issue then please tell us a bit more about your problem and/or post some of the weird content you got.
It also might be helpful if you could post your code where you read the response content out of your response object.