var url = "my html url"; var httpClient = new HttpClient(); var html = await httpClient.GetStringAsync(url); var htmlDocument = new HtmlDocument(); htmlDocument.LoadHtml(html); HtmlNode divContainer = htmlDocument.DocumentNode .SelectSingleNode("//div[@class='someclass']"); Console.WriteLine(divContainer.InnerHtml);above code gave me this
<iframe src="video.com/sadas" scrolling="no" frameborder="0" width="640" height="360" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true">iframe>p>finally , i want to exclude "p" tag from output , please help me with that.
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hiten PandyaPosted Mar 18, 2018, 11:22 PM
tag which is under some div.