The WebResponse I get from a multiform POST is being parsed by me. When I try to document, I can't get the H3 tags out. I get null errors after loading the stream, such as "Cannot implicitly convert type 'void' to 'HtmlAgilityPack.HtmlNodeCollection' "
I now realize that my web response initially contains nothing but slowly fills up. How can I make this work such that the streamreader always returns null?
//web response stuff here WebResponse ricochet = webrreq.GetResponse(); Stream stream2 = ricochet.GetResponseStream(); StreamReader reader2 = new StreamReader(stream2); HtmlAgilityPack.HtmlDocument document= new HtmlAgilityPack.HtmlDocument(); //line with null error below var collection = document.Load(reader2.ReadToEnd());
For Future Use:
The collection won't let me attach it to a document. I must first load the stream before using the Agility pack to once again locate the proper nodes.
var thingie = document.Load(reader2.ReadToEnd()); var collection = thingie.DocumentNode.SelectNode("//etc");