0

I'm completely new here and this is my first question. I'm scared.

I will be honest, I'm completely new at HTML and javascript, and my doubt is the following: I'm performing an HttpWebRequest in order to get a string with some text in html format. This text contains lots of javascript code, but what I actually need is to get a string containing the interpreted html (this means, what a browser would do when executing that source code after having entered the corresponding URL in the browse bar).

Is there any way to make such a conversion in C#?

Rand Random
  • 7,300
  • 10
  • 40
  • 88
DanZeit
  • 11
  • 4
    A *thing* that parses HTML and JavaScript in the same way as a browser is called a Headless Browser, see [Headless browser for C# (.NET)?](https://stackoverflow.com/questions/10161413/headless-browser-for-c-sharp-net) – Alex K. Nov 16 '17 at 15:40
  • 2
    `HttpWebRequest` doesn't do this. What you're looking for is something called a "headless browser". .NET doesn't have such a component internally (at least, not that I know of) so you'd need to find something 3rd party. A "headless browser" is an in-code component which would act like a web browser (interpret JavaScript, etc.) but not have a user interface. You'd interact with it in code. – David Nov 16 '17 at 15:40

1 Answers1

-1

Html.Raw() can be,

in ASP.NET MVC Razor view

For example: Html.Raw("<div>").

jfreire
  • 41
  • 5