02 2014 档案

使用Jsoup获取网页内容超时设置
摘要:最近使用Jsoup来抓取网页,并对网页进行解析,发现很好用。在抓取过程中遇到一个问题,有些页面总是报Timeout异常,开始想是不是被抓取网站对IP进行了限制,后来发现用HttpClient可以获取到内容。原来我最开始使用Jsoup.connect(url).get();方法获取网页内容,这种方式使用的是默认超时时间3秒。原来Jsoup是可以设置超时的,修改成如下就可以了:Jsoup.connect(url).timeout(30000).get(); // 30S 阅读全文

posted @ 2014-02-12 18:02 liwp_Stephen 阅读(4250) 评论(1) 推荐(0) 编辑

微信公众平台回复音乐
摘要:微信回复音乐的接口说明,需要thumb_media_id,但是这个值不知道从哪里获取,在网上查了一下,原来这个字段可以不设置的。网上的回复如下:可以回复音乐,按music结构回复即可。ThumbMediaId可以不填,我正在找怎么在上传素材中找到MediaId -- 不要加到回复的XML中。 阅读全文

posted @ 2014-02-12 17:55 liwp_Stephen 阅读(1651) 评论(0) 推荐(0) 编辑

Else is very important
摘要:If else statement is very frequently used by developers.Sometimes we will add if condition, but sometimes, else statement is missed, so a lot of issues will be caused by this error.Today, I am fix an issue about change some setting, but the related setting is not updated.After investigate the code, 阅读全文

posted @ 2014-02-11 17:12 liwp_Stephen 阅读(274) 评论(0) 推荐(0) 编辑

Generate source code from wsdl
摘要:Yesterday, one of Automation QA find that generate source code from WSDL failed, and let me to find the problem.One of them is there are two methods with similar name, just as “taksSnapshot”, and another is “TakeSnapshot”, in java, these two method is OK, but when generate source code with wsimport, 阅读全文

posted @ 2014-02-11 09:58 liwp_Stephen 阅读(1043) 评论(0) 推荐(0) 编辑

PHP Simple HTML DOM Parser: check elements with multiple classes
摘要:Get the information from this link:http://stackoverflow.com/questions/14264525/php-simple-html-dom-parser-select-only-divs-with-multiple-classesSimple answer:find(".class1.class2")this will look for any type of element (div,img,a etc..) that has both class1 and class2. If you want to speci 阅读全文

posted @ 2014-02-06 10:13 liwp_Stephen 阅读(297) 评论(0) 推荐(0) 编辑

导航

点击右上角即可分享
微信分享提示