//读取网页上的内容方法---------------------2010.01.25 public String getOneHtml(String htmlurl) throws IOException {
URL url;
String temp;
final StringBuffer sb = new StringBuffer();
try {
url = new URL(htmlurl);
// 读取网页全部内容
final BufferedReader in = new BufferedReader(new InputStreamReader(
url.openStream(),"GBK"));
while ((temp = in.readLine()) != null) {
sb.append(temp);
}
in.close();
} catch (final MalformedURLException me) {
System.out.println("你输入的URL格式有问题!请仔细输入");
me.getMessage();
} catch (final IOException e) {
e.printStackTrace();
}
return sb.toString();
}上面这个方法是根据你传入的url爬取整个网页的内容,然后你写个正则表达式去匹配这个字符串的内容。
第一个是用js做的跳转
点击链接以后设置他下面一个表单属性的值
然后提交了这个表单 搞到值了以后直接你设置 documentId=xxx 往表单action里面发数据就搞到链接了
可能是正则表达式写错了,你用工具测试一下。
把网站地址链接加入