1
Answer

c# get iframe kod with htmlagilitypack?

Bkr Knk

Bkr Knk

6y
1.5k
1


 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)