.net equivalent of htmlunit?
Asked Answered
P

3

25

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
Pollux answered 17/3, 2010 at 15:52 Comment(1)
Possible duplicate of #1513132Tactics
B
15

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.

Butlery answered 12/12, 2011 at 8:22 Comment(4)
asbjornu, how's the performance of NHtmlUnit? Have you tested it perchance, or could you share any anecdotal evidence or gut feelings?Broddy
I'm one of the developers of NHtmlUnit and it performs very comparably to HtmlUnit since the Java code is translated into MSIL at the bytecode level and the whole Java class library is provided through IKVM as MSIL bytecode as well.Boren
Is it possible to use NHtmlUnit with WebDriver (e.g., Selenium)?Hydr
@Hydr I would rather say it goes the other way around. You use HtmlUnit in WebDriver, so you can program against one interface (WebDriver) and have the same code execute in several different "browsers" such as HtmlUnit.Boren
A
5

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

Austria answered 19/7, 2010 at 11:38 Comment(0)
S
1

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.

Sock answered 17/3, 2010 at 15:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.