Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
var doc = htmldocument.DocumentNode.SelectNodes("//div[starts-with(@class, 'sense-block')]");
            foreach (var div in doc)
            {
                Assets.Dictionary Dic = new Assets.Dictionary();
                string vob = div.SelectSingleNode(".//span[@class='hw']").ToString();
                string word = div.SelectSingleNode(".//span[@class='pos']").InnerText.Trim();
                string pra = div.SelectSingleNode(".//span[@class='guideword']").InnerText.Trim();
                if(vob==null && worb==null && pra==null)
                {
                    Dic.Example = div.SelectSingleNode(".//span[@class='def-block']").InnerText.Trim();
                    Dic.Explaining = div.SelectSingleNode(".//span[@class='def']").InnerText.Trim();

                    Lst.Add(Dic);
               
                }
}


That program was be broken right here
C#
string vob = div.SelectSingleNode(".//span[@class='hw']").ToString();

Can't keeps next below steps
Posted
Comments
PIEBALDconsult 19-Jan-15 23:03pm    
We may need to see a small snippet of the document.

1 solution

word,pra are still null.
That program to be stopped at the "string vob". I can't checking these below line "if".
 
Share this answer
 
Comments
PIEBALDconsult 19-Jan-15 23:02pm    
Please don't put that in an "answer"; use Improve question to add it to the question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900