I am trying to parse the WebResponse I get from a multiform POST. I want to pull out the H3 tags, but when I go to document.Load the stream, I get null errors like this: "Cannot implicitly convert type 'void' to 'HtmlAgilityPack.HtmlNodeCollection' "
Now I understand my webresponse starts out null, but it fills up eventually. How can I get this to run with the streamreader returning null automatically?
//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());
Load()
that accepts a stream. No need to read as a string first.