Bkr Knk

Bkr Knk

  • 1.9k
  • 19
  • 1.6k

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.

Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.

Answers (1)