- 浏览: 1491886 次
- 性别:
- 来自: 杭州
文章分类
- 全部博客 (525)
- SEO (16)
- JAVA-EE-Hibernate (6)
- JAVA-EE-Struts (29)
- JAVA-EE-Spring (15)
- Linux (37)
- JAVA-SE (29)
- NetWork (1)
- CMS (14)
- Semantic Research (3)
- RIA-Flex (0)
- Ajax-Extjs (4)
- Ajax-Jquery (1)
- www.godaddy.com (0)
- SSH (34)
- JavaScript (6)
- SoftwareEngineer (9)
- CMMI (0)
- IDE-Myeclipse (3)
- PHP (1)
- Algorithm (3)
- C/C++ (18)
- Concept&Items (2)
- Useful WebSite (1)
- ApacheServer (2)
- CodeReading (1)
- Socket (2)
- UML (10)
- PowerDesigner (1)
- Repository (19)
- MySQL (3)
- SqlServer (0)
- Society (1)
- Tomcat (7)
- WebService (5)
- JBoss (1)
- FCKeditor (1)
- PS/DW/CD/FW (0)
- DesignPattern (11)
- WebSite_Security (1)
- WordPress (5)
- WebConstruction (3)
- XML|XSD (7)
- Android (0)
- Project-In-Action (9)
- DatabaseDesign (3)
- taglib (7)
- DIV+CSS (10)
- Silverlight (52)
- JSON (7)
- VC++ (8)
- C# (8)
- LINQ (1)
- WCF&SOA (5)
- .NET (20)
- SOA (1)
- Mashup (2)
- RegEx (6)
- Psychology (5)
- Stock (1)
- Google (2)
- Interview (4)
- HTML5 (1)
- Marketing (4)
- Vaadin (2)
- Agile (2)
- Apache-common (6)
- ANTLR (0)
- REST (1)
- HtmlAnalysis (18)
- csv-export (3)
- Nucth (3)
- Xpath (1)
- Velocity (6)
- ASP.NET (9)
- Product (2)
- CSS (1)
最新评论
-
lt26w:
理解成门面模式应该比较容易明白吧
FacadePattern-Java代码实例讲解 -
lt26w:
看下面的例子比较明白.
FacadePattern-Java代码实例讲解 -
javaloverkehui:
这也叫文档,别逗我行吗,也就自己看看。
HtmlCleaner API -
SE_XiaoFeng:
至少也应该写个注释吧。
HtmlCleaner API -
jfzshandong:
...
org.springframework.web.filter.CharacterEncodingFilter 配置
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> package com.lihan.dao; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.commons.httpclient.Cookie; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.NameValuePair; import org.apache.commons.httpclient.cookie.CookiePolicy; import org.apache.commons.httpclient.methods.PostMethod; public final class LoginXiaonei { public static void main(String[] a) { HttpClient client = new HttpClient(); PostMethod post = new PostMethod( " http://login.xiaonei.com/Login.do " ); post.setRequestHeader( " Content-Type " , " application/x-www-form-urlencoded " ); client.getParams().setContentCharset( " utf-8 " ); client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY); NameValuePair[] data = { new NameValuePair( " email " , " ********@163.com " ), new NameValuePair( " password " , " ****** " ) }; post.setRequestBody(data); try { client.executeMethod(post); Cookie [] cookies = client.getState().getCookies(); InputStream stream = post.getResponseBodyAsStream(); writeStream(stream); stream.close(); post.releaseConnection(); post = new PostMethod( " http://msg.xiaonei.com/message/send.do " ); post.setRequestHeader( " Content-Type " , " application/x-www-form-urlencoded " ); data = new NameValuePair[]{ new NameValuePair( " ids[] " , " 227949683 " ) , new NameValuePair( " subject " , " hahahahaha " ) , new NameValuePair( " message " , " 0 " ) , }; post.setRequestBody(data); client.executeMethod(post); stream = post.getResponseBodyAsStream(); writeStream(stream); stream.close(); post.releaseConnection(); } catch (HttpException ex) { Logger.getLogger(XiaoNeiBlog. class .getName()).log(Level.SEVERE, null , ex); } catch (IOException ex) { Logger.getLogger(XiaoNeiBlog. class .getName()).log(Level.SEVERE, null , ex); } } private static void writeStream(InputStream stream) throws IOException { BufferedReader reader = new BufferedReader( new InputStreamReader(stream, " utf-8 " )); String line = null ; for (line = reader.readLine();line != null ;line = reader.readLine()) { System.out.println(line); } reader.close(); } }
发表评论
-
htmlunit 示例
2010-08-20 18:40 4313先下载依赖的相关JAR包:http://sourcefor ... -
HTMLParser的两种使用方法
2010-04-15 16:37 5377HTMLParser的两种使用方法 ... -
HtmlCleanner结合xpath用法
2010-04-15 13:24 3526文章分类:Java编程 ... -
基于Htmlparser的天气预报程序(续)
2010-04-14 13:53 1068zz:http://www.iteye.com/topic/6 ... -
httpclient(校内网)
2010-04-13 15:10 1404httpclient(校内网),大家帮忙看看我的 http ... -
HTTPClient模拟登陆人人网
2010-04-13 14:58 1881zz: 目的: http://www.iteye. ... -
HtmlCleaner API
2010-04-13 13:40 4464HtmlCleaner API Create cleaner ... -
htmlcleaner惯用法
2010-04-13 13:39 1427Common usage Tipically the f ... -
htmlcleaner惯用法
2010-04-13 13:39 1501Common usage Tipically t ... -
htmlcleaner 使用示例.
2010-04-13 13:10 10007原文出处:http://blog.chenlb.com/200 ... -
http://htmlparser.com.cn/
2010-04-12 16:20 1033http://htmlparser.com.cn/ ... -
开源网络蜘蛛spider(转载)
2010-04-12 15:42 1310spider是搜索引擎的必须 ... -
基于Spindle的增强HTTP Spider
2010-04-12 15:33 1462zz:http://www.iteye.com/news ... -
Cobra: Java HTML 解析器
2010-04-12 15:32 2921Cobra 简介: Cobra是一个 ... -
用htmlparser分析并抽取正文
2010-04-12 15:26 1539我这次要介绍的是如何抽取正文,这部分是最为核心的.因为如果不能 ... -
HtmlParser初步研究
2010-04-12 15:18 910目的是快速入手,而不 ... -
基于Htmlparser的天气预报程序
2010-04-12 15:16 1058htmlparser是一个纯的java写的html解析的库,它 ...
相关推荐
httpclient
httpClient完整封装获取网页信息、数据的代码+httpclient.jar
HttpClient httpClient = new HttpClient(); // 设置 Http 连接超时为5秒 httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(5000); /* 2 生成 GetMethod 对象并设置参数 */ GetMethod ...
httpclient-4.5所需jar包,里面包含httpclient-4.5.jar等等10个必须的开发包。 1.commons-codec-1.9.jar 2.commons-logging-1.2.jar 3.fluent-hc-4.5.jar 4.httpclient-4.5.jar 5.httpclient-cache-4.5.jar 6....
httpclient.jar下载 包括code.jar包
赠送jar包:httpclient-4.5.6.jar; 赠送原API文档:httpclient-4.5.6-javadoc.jar; 赠送源代码:httpclient-4.5.6-sources.jar; 赠送Maven依赖信息文件:httpclient-4.5.6.pom; 包含翻译后的API文档:httpclient...
HttpClient的一个封装, HttpClient的一个封装
C# HttpClientHelper(HttpClient工具类) 包含 同步/异步请求 返回 string/泛型类型/Xml 及一个单例模式 的 SingleHelper 适合做爬虫
import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.methods....
httpclient jar包 httpclient jar包 httpclient jar包
赠送jar包:httpclient-4.5.13.jar; 赠送原API文档:httpclient-4.5.13-javadoc.jar; 赠送源代码:httpclient-4.5.13-sources.jar; 赠送Maven依赖信息文件:httpclient-4.5.13.pom; 包含翻译后的API文档:...
赠送jar包:httpclient-4.5.5.jar; 赠送原API文档:httpclient-4.5.5-javadoc.jar; 赠送源代码:httpclient-4.5.5-sources.jar; 包含翻译后的API文档:httpclient-4.5.5-javadoc-API文档-中文(简体)版.zip ...
赠送jar包:httpclient-4.5.13.jar; 赠送原API文档:httpclient-4.5.13-javadoc.jar; 赠送源代码:httpclient-4.5.13-sources.jar; 赠送Maven依赖信息文件:httpclient-4.5.13.pom; 包含翻译后的API文档:...
帮助程序员快速从Apache的HttpClient 3.x升级到HttpClient 4.x
httpclient方式调用url
httpClient4.3.6 HttpClient使用详解 httpClient中文帮助文档
httpClientUtil工具类
HttpClient jar包