在http://haom.biz/ 网站    输入姓,名,年,月,日等
 点击【名字打分】 ,会得到测名结果
上面过程想通过程序httpclient操作:
想要得到的数据 如下:
    总评数理得分:XX 分 中的XX

解决方案 »

  1.   

    代码就不写了,告诉你思路。用httpclient post请求这个地址: http://haom.biz/chest/xmdf.php 带上下面参数:
    xing=(姓)
    ming=(名)
    sex=(性别)
    y=年
    m=月
    d=日
    h=0
    i=0出来的结果就是网页了。然后用正则匹配<font color=green><b>总评数理得分:53 分 </b></font><br>这样的一段,大功告成!
      

  2.   

    会报错。。顶
    public static void main(String[] args) throws Exception {
    HttpClient httpClient = new HttpClient(); PostMethod getMethod = new PostMethod("http://haom.biz/chest/xmdf.php"); getMethod.setParameter("xing", "喜");
    getMethod.setParameter("ming", "来乐");
    getMethod.setParameter("sex", "男");
    getMethod.setParameter("y", "1988");
    getMethod.setParameter("m", "4");
    getMethod.setParameter("d", "16");
    getMethod.setParameter("h", "8"); httpClient.executeMethod(getMethod); System.out.println(getMethod.getResponseBodyAsString()); }