WebBrowsing in C# - Libraries, Tools etc. - Anything like Mechanize in Perl? [closed]

一笑奈何 提交于 2019-11-29 22:30:41

I've been using WatiN to great effect. It's an easy way to 1) automate user input w/ IE and 2) navigate the DOM.

You can use the WebBrowser control, which can be automated to an extent.

You need to use the HTML Agility Pack, which can parse tag soup from real websites into a DOM structure.

You can also use Selenium. It's for unit testing web sites. It has a java application that drives the browser and a C# interface that you can write your code in. It also has the downside of showing the browser, but it's pretty full featured in terms of control, waiting on responses and getting the results.

Design Canvas is the best tool out there for this type of thing. Works with IE, Firefox, Safari, or an in-memory browser. It allows you to record and then playback any kind of web interaction.

You want HttpWebRequest for automating web requests and HtmlAgilityPack for processing the resulting HTML.

I have reverse engineered Python-Mechanize, and recreated it in C#, called Mechanize.NET.

https://github.com/WilliamABradley/Mechanize.NET

This should hopefully cover all use cases of Mechanize, if not, or you discover a bug, create an issue.

It uses .NET Standard, so it should be usable across .NET, such as with F#, VB, etc.

It utilises HtmlAgilityPack internally, and you can even collect the HtmlDocument for each loaded page.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!