Seeking a robust headless browser for .NET multithreaded applications

Hey everyone, I’m on the hunt for a powerful headless browser that can handle .NET multithreaded apps. Here’s what I need:

  • No server install required, just a simple library
  • Ajax and HTML5 support
  • Ability to interact with page elements (find/read attributes, click buttons, fill forms)
  • Proper cookie handling for multiple responses and session storage
  • Customizable user agent (at least Chrome/Firefox options)
  • Multithreading support for many concurrent users (2 to 100k+)
  • Fast performance
  • HTTPS support with insecure SSL

I’ve looked at a few options like PhantomJS, HtmlUnit with ikvm, WebKit.Net, HTML Agility Pack, and Awesomium. But I’m not sure which one fits my needs best.

Has anyone used any of these or know of other solutions that might work? I’d really appreciate some advice and maybe a few .NET code examples if you’ve got them. Thanks!

I’d recommend looking into Puppeteer Sharp. It’s a .NET port of the popular Puppeteer library and checks most of your boxes. It’s lightweight, supports AJAX and modern web standards, and allows for extensive page interactions. The library handles cookies and sessions well, lets you set custom user agents, and works with HTTPS including insecure SSL connections.

Performance-wise, it’s quite fast and efficient. While it doesn’t natively support extreme concurrency (100k+ threads), it can handle a good number of simultaneous operations when properly configured. You might need to implement your own thread management for very high concurrency scenarios.

One potential drawback is that it requires Chrome/Chromium to be installed, but this offers the benefit of a real browser engine for maximum compatibility. Overall, it’s a solid choice for .NET headless browser automation.

I’ve been using CefSharp in my .NET projects and it’s been a game-changer. It’s based on Chromium, so you get top-notch HTML5 and AJAX support. The best part? It’s incredibly flexible for interacting with page elements - you can easily find elements, read attributes, click buttons, and fill forms.

Cookie handling and session storage work seamlessly, and you can customize the user agent without breaking a sweat. While it’s not explicitly designed for massive concurrency, I’ve successfully used it in multithreaded scenarios with a few dozen concurrent users.

Performance-wise, it’s pretty snappy, especially if you tweak the settings. And yes, it handles HTTPS with insecure SSL just fine. The learning curve can be a bit steep, but once you get the hang of it, it’s incredibly powerful. Just make sure you’re okay with the Chromium dependency - it’s not a deal-breaker for most projects, but worth considering.

have u tried selenium? its pretty good for what ur looking for. i use it with c# and it handles everything u mentioned. its fast, supports multithreading, and u can customize user agents. plus theres lots of documentation n examples online. might wanna give it a shot