I'll try to help you, however I'm a little puzzled about your explanation and your foreach block.
What do you like to achieve?
Extract all the SPAN elements into an array?
Count them?
EDIT:
Ok, i think I got it. I hope, at least :)
Just to be sure, are you like to get an output array like this:
string[] shipping_array = new string[]
{
"class=""c""",
"0",
"class=""c2""",
null
};
It seems to be a little inconsistent, however I don't know the backgrounds.
So, my next questions are:
* From where comes the '2' character in the third array element? It is a counter of found 'c' classes?
* Do you not defined the fourth array element. Why? There is any difference between short spans?
EDIT:
Try something similar:
var results = new List<string>();
var divs = doc.DocumentNode.SelectNodes("//div");
foreach (var div in divs)
results.Add(div.SelectNodes("span[@class='c']") == null ? "0" : "class=\"c\"");