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

本秂侑毒 提交于 2019-12-18 08:23:20

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/122614/is-there-a-net-equivalent-of-perls-lwp-wwwmechanize

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