2

I need to submit some data on a website in-order to register a server. I need to enter information onto a form in the first webpage and upon submitting the information, the webpage takes me to a dynamically created page (I also need to retrieve this page) where I have to enter more information in the form.

I need to accomplish this task programmatically. I can either use Java, Javscript or C#. I am familiar with the languages, but not completely sure what libraries could I use in any of the languages to achieve this task. I would really appreciate it if you guys can provide some help/hints or starting points on this issue.

Thanks

4

3 回答 3

1

There are many choices out there. Look for something that implements an HTTP user agent.

One Java library i use often and recommend is Apache Commons Httpclient

于 2012-04-10T20:38:34.683 回答
1

完全可以使用 Commons HttpClient,但是对于您的要求来说它可能有点太低了。

HTMLUnit模拟一个浏览器,它应该让登录网站、浏览和提交表单变得相对容易。这里有一个提交表单的例子:http: //htmlunit.sourceforge.net/gettingStarted.html

于 2012-04-10T20:53:40.360 回答
0

如果站点需要启用 javascript 并进行大量客户端处理(ajax 等),那么您可以尝试Selenium 。

于 2012-04-10T20:51:10.403 回答