Bkr Knk

Bkr Knk

  • NA
  • 19
  • 3.1k

c# get iframe kod with htmlagilitypack?

Mar 18 2018 10:01 AM


 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

 <p><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.


Answers (1)