Select meta tag using c#? -
this xml want select meta tag
<meta charset="utf-8"> <title>gmail: email google</title> <meta name="description" content="10+ gb of storage, less spam, , mobile access. gmail email that's intuitive, efficient, , useful. , maybe fun."> <link rel="icon" type="image/ico" href="//mail.google.com/favicon.ico">
i doing this
string texturl = textbox2.text; string url = "http://" + texturl; htmlweb web = new htmlweb(); htmlagilitypack.htmldocument doc = web.load(url); var spannodes = doc.documentnode.selectnodes("//meta"); if (spannodes != null) { foreach (htmlnode sn in spannodes) { string text = sn.innertext; messagebox.show(text); }
its not selecting text there............what doing wrong please help
meta
elements self-closing elements, meaning have no text children (innertext). believe want value of content
attribute. believe using sn["content"]
, don't know htmlagilitypack.
Comments
Post a Comment