Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.net equivalent of htmlunit?

Tags:

Does anybody know if there is a .net equivalent of htmlunit or similar library?

I've heard that people have used IKVM to convert the htmlunit library. But I have also heard that the converted code is slow.

Requirements:

  • Headless browser
  • Support javascript
  • Handle cookies
  • .Net
like image 262
mike Avatar asked Mar 17 '10 15:03

mike


3 Answers

You can try out the just-released NHtmlUnit (available on NuGet), which is a .NET-wrapper for HtmlUnit. It's not .NET as in "written in a .NET language and compiled to MSIL", but it's converted to .NET with IKVM and we've written a layer of "purified" C# code on top of it so everything looks and behaves like .NET.

like image 96
Asbjørn Ulsberg Avatar answered Jan 14 '23 13:01

Asbjørn Ulsberg


You can use Htmlunit from .net with ikvm. I followed the instructions at http://blog.stevensanderson.com/2010/03/30/using-htmlunit-on-net-for-headless-browser-automation/ and it worked for me.

edit: it is slow though. recently I've been using Selenium Server with the .net client

like image 26
mcintyre321 Avatar answered Jan 14 '23 13:01

mcintyre321


Nothing yet that fulfils all of your requirements.

XBrowser is a headless browser that handles cookies, but does not support javascript. It is however in active development so this may change.

like image 21
Oded Avatar answered Jan 14 '23 12:01

Oded