给出新浪新闻的url,怎样解析出新闻标题!
例如给定http://tech.sina.com.cn/d/2009-05-11/08403079398_2.shtml,解吸出八大最怪异植物:成年巨型散尾葵
例如给定http://tech.sina.com.cn/d/2009-05-11/08403079398_2.shtml,解吸出八大最怪异植物:成年巨型散尾葵
解决方案 »
- jdbc连接sql server 中文乱码,为解决这个问题,我写了一个类,但是没用
- js出错
- 关于验证码的生成
- ActionForm 中的validate()如何控制出错时跳转的页面
- 数据库连不上
- 大家帮我看看,在spring环境下做单元测试怎么通不过呀
- 用axis开发Web Services客户端遇到的问题,急
- 配置数据源之后,tomcat无法启动
- 请问如何在浏览器下调用excel打开.csv文件?
- 求解
- 谁有james开发示例?急用!!!!
- tomact5.0和webogic8+MyEclipse 6.0同样的程序tomact5.0没问题weblogic8却有问题,在线急等高手解决,查出原因。
URL tirc = new URL(
"http://tech.sina.com.cn/d/2009-05-11/08403079398_2.shtml");
BufferedReader in = new BufferedReader(new InputStreamReader(tirc
.openStream(), "gbk"));
String inputLine;
int codeStar = -1;
int cstar = 0;
String tempCode = null;
String companyCode = null;
int flag = 0;
while ((inputLine = in.readLine()) != null) {
System.out.println(inputLine);
}
in.close();
去改 一下吧..
但也许与标题无任何关系,比如,08403079398仅仅只是个网页名字,对应web上的一个网页而已