简体   繁体   中英

Is there a .NET equivalent of Perl's LWP / WWW::Mechanize?

After working with .NET's HttpWebRequest / Response objects, I'd rather shoot myself than use this to crawl through web sites. I'm looking for an existing .NET library that can fetch URLs, and give you the ability to follow links, extract/fill in/submit forms on the page, etc. Perl's LWP and WWW::Mechanize modules do this very well, but I'm working with a .NET project.

I've come across the HTML Agility Pack , which looks awesome, but it stops short of simulating links/forms.

Does such a tool already exist?

Somebody built a bit of code to run as an addon to the HTML Agility Pack (which I also love) that allows you to do a bit of form tinkering:

http://apps.ultravioletconsulting.com/projects/uvcwebtransform/docs/class_html_agility_pack_1_1_add_ons_1_1_form_processor_1_1_form_processor.html

I read a review that says it's not WWW::Mechanize, but it's a great start. The code is provided, so you might be able to easily extend it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM