开发者

Calling javascript method on html page, loaded in C#

Is it po开发者_Python百科ssible? I mean, I have loaded html page (with HtmlAgilityPack for example) and javascript file. I need to apply javascript method from this file (or whole javascript file) to my loaded html page and do this from C# code. Then save result html to filesystem. Can I do that?


You will need to use a headless browser to apply the javascript to the page first.

See this SO question about headless browsers for .NET - there should be something suitable.


If this is a winforms app, you might be able to use the web browser control to load the page (which should then fire the javascript) and then try to scrape the resulting HTML from the page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜