Is there a simple way to inject a javascript into a HtmlDocument object without using PhantomJS? Is there such a method in HtmlAgilityPack.HtmlDocument class?
Any advice is apreciated, Thank you!
You can inject a script tag (with script in it) in a HTMLDocument.
You still need something to execute the javascript though. If you want your c# code to somehow evaluate the result of the javascript - especially if you are doing dom manipulation - then PhantomJS is probably the best way to go as it's a headless browser that you can run without user interaction and interface.
The short answer is yes, but i think what you want is not possible without an engine that knows both javascript and the html dom. There are alternatives to PhantomJS like http://slimerjs.org/ so my cheeky answer is still yes ;)
Hint: Don't be afraid to run PhantomJS or the like.