Headless browser for C# (.NET)?

Bo Milanovich picture Bo Milanovich · Apr 15, 2012 · Viewed 46.5k times · Source

I am (was) a Python developer who is building a GUI web scraping application. Recently I've decided to migrate to .NET framework and write the same application in C# (this decision wasn't mine).

In Python, I've used the Mechanize library. However, I can't seem to find anything similar in .NET. What I need is a browser that will run in a headless mode, which has the ability to fill out forms, submit them, etc. JavaScript parser is not a must, but it would be quite useful.

Answer

Yahia picture Yahia · Apr 15, 2012

There are some options:

  • WebKit.Net (free)

  • Awesomium
    It is based on Chrome/WebKit and works like a charm. There is a free license available but also a commercial one and if need be you can buy the source code :-)

  • HTML Agility Pack (free) (An HTML Parser library, NOT a headless browser)
    This helps with extracting information from HTML etc. and might be useful in your case (possibly in combination with HttpWebRequest)