深圳公司开发网站互联网怎么做
web/
2025/9/25 11:14:20/
文章来源:
深圳公司开发网站,互联网怎么做,网页编辑软件朱,做网站颜色类型是啥由于工作原因#xff0c;需要每隔半小时刷新一些网页#xff0c;并查看上面的数据是否有更新。这件事能否自动化进行呢#xff1f;查找了下Java相关的资料#xff0c;蹦出一个关键词#xff1a;HttpClient。 HttpClient是常用Http客户端库#xff0c;相关的资料也不少需要每隔半小时刷新一些网页并查看上面的数据是否有更新。这件事能否自动化进行呢查找了下Java相关的资料蹦出一个关键词HttpClient。 HttpClient是常用Http客户端库相关的资料也不少只是网上找到的资料好多都是不能用于4.5版的HttpClient还是需要自己摸索。 在eclipse里新建一个maven工程(maven 3)在pom.xml中做如下设置 1 project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd2 modelVersion4.0.0/modelVersion3 groupIdtest/groupId4 artifactIdadmin.test.httpclient/artifactId5 version0.0.1-SNAPSHOT/version6 dependencies7 dependency8 groupIdorg.apache.httpcomponents/groupId9 artifactIdhttpclient/artifactId
10 version4.5/version
11 /dependency
17 /dependencies
18 build
19 finalNameMvnTest/finalName
20 plugins
21 plugin
22 artifactIdmaven-compiler-plugin/artifactId
23 version2.0.2/version
24 configuration
25 source1.5/source
26 target1.5/target
27 /configuration
28 /plugin
29 /plugins
30 /build
31 /project 在pom.xml上运行maven install命令完成之后在“Maven Dependencies”下有了四个jar包 拿某个知名网站发送GET请求做测试看看效果 1 public class HttpClientTest {2 private static String HOST www.sina.com;3 private static String BASE_URL http://HOST/;4 public static void main(String[] args) throws ClientProtocolException, IOException 5 CloseableHttpClient httpClient HttpClients.createDefault();6 /// 设置GET请求参数URL一定要以http://开头7 HttpGet getReq new HttpGet(BASE_URL);8 /// 设置请求报头模拟Chrome浏览器9 getReq.addHeader(Accept, application/json, text/javascript, */*; q0.01);
10 getReq.addHeader(Accept-Encoding, gzip,deflate,sdch);
11 getReq.addHeader(Accept-Language, zh-CN,zh;q0.8);
12 getReq.addHeader(Content-Type, text/html; charsetUTF-8);
13 getReq.addHeader(Host, HOST);
14 getReq.addHeader(User-Agent, Mozilla/5.0 (Windows NT 5.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36);
15 /// 发送GET请求
16 CloseableHttpResponse rep httpClient.execute(getReq);
17 /// 从HTTP响应中取出页面内容
18 HttpEntity repEntity rep.getEntity();
19 String content EntityUtils.toString(repEntity);
20 /// 打印出页面的内容
21 System.out.println(content);
22 /// 关闭连接
23 rep.close();
24 httpClient.close();
25 }
26 } 得到的页面内容 1 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd2 !--[5019,2,1] published at 2015-01-01 14:46:19 from #110 by 22--3 html xmlnshttp://www.w3.org/1999/xhtml4 head5 meta http-equivContent-Type contenttext/html; charsetutf-8 /6 titleWWW.SINA.COM/title7 meta namekeywords contentsina, ??°??? /8 meta namedescription content??°???é??é?? /9 10 style typetext/css11 !--12 /* basic setup */13 body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, form, fieldset, legend, input, textarea, p, blockquote, th, td {margin: 0; padding: 0;}14 body {background: #ebebed url(http://ui.sina.com/assets/img/www/bg_gradient.gif) repeat-x; font-family: Arial, Helvetica, sans-serif; min-height: 100%;}15 img {border: 0;}16 em {position: absolute; left: -9999em;}17 .clearDiv {clear: both;}18 #wrap { padding: 50px 0 10px;margin:0 auto; width: 775px}19 20 /* Header */21 #header {position: relative; margin: 0 auto; width: 775px; border-bottom: 1px solid #ffa600;}22 #header h1 {float: left; margin: 0; width: 275px; height: 50px; background: url(http://ui.sina.com/assets/img/www/sina_id_www.gif) no-repeat top left;}23 #header ul {float: left; margin: 0; width: 500px; height: 50px; list-style: none; font-size: 12px; color: #333; text-transform: capitalize;}24 #header ul li {float: right; margin: 30px 0 0 0;}25 #header ul li a {color: #333; text-decoration: none;}26 #header ul li a:hover {color: #ff9900; text-decoration: none;}27 28 #map {position: relative; margin: 0; width: 775px; height: 248px;}29 30 #channel {position: relative; margin: 0; width: 775px; border-bottom: 1px solid #ffa600;}31 32 /* Footer */33 #footer {position: relative; margin: 0 auto; width: 775px; border-top: 1px solid #ffa600;}34 #footer ul {margin: 10px auto; padding: 0; width: 775px; list-style: none; font-size: 12px; color: #333; text-transform: capitalize; text-align: center;}35 #footer ul li {display: inline; padding: 2px 5px;}36 #footer ul li a {color: #333; text-decoration: none;}37 #footer ul li a:hover {color: #ff9900; text-decoration: none;}38 39 /* ads */40 #ads {position: relative; margin: 5px 0; padding: 0; width: 775px;}41 #ads ul {margin: 5px 0; width: 775px; list-style: none; text-align: center;}42 #ads ul li.bnr728 {margin: 5px auto; padding: 0; width: 775px; height: 90px;}43 #ads ul li.bnr545 {float: left; margin: 5px auto; padding: 0; width: 620px; height: 80px;}44 #ads ul li.bnr120 {float: left; margin: 5px auto; padding: 0; width: 155px; height: 60px; line-height: 60px;}45 #ads ul li.bnr120_2 {float: left; margin: 5px auto; padding: 0; width: 155px; height: 80px; line-height: 80px;}46 47 --48 /style49 50 !-- swfObject --51 script typetext/javascript srchttp://ui.sina.com/assets/js/swfobject.js/script52 53 !-- btn.5 --54 script typetext/javascript55 var flashvars {};56 var params {};57 params.base ;58 params.menu true;59 params.scale noscale;60 params.bgcolor #fff;61 params.quality best;62 // params.allowfullscreen true;63 params.salign c;64 params.wmode window;65 var attributes {};66 swfobject.embedSWF(http://ui.sina.com/rm/toyota/091110/toyota_120x60_4_091110.swf, btn5, 120, 60, 9.0.0, expressInstall.swf, flashvars, params, attributes);67 68 /script69 !-- END --70 71 /head72 body73 74 !-- SUDA_CODE_START -- 75 div styleposition:absolute;top:0;left:0;width:0;height:0;z-index:1div styleposition:absolute;top:0;left:0;width:1;height:1;iframe idSUDA_FC src width1 height1 SCROLLINGNO FRAMEBORDER0/iframe/divdiv styleposition:absolute;top:0;left:0;width:0;height:0;visibility:hidden idSUDA_CS_DIV/div/div 76 script typetext/javascript 77 //!--78 var SSL{Config:{},Space:function(d){var bd,cnull;bb.split(.);cSSL;for(i0,lenb.length;ilen;i){c[b[i]]c[b[i]]||{};cc[b[i]]}return c}};SSL.Space(Global);SSL.Space(Core.Dom);SSL.Space(Core.Event);SSL.Space(App);SSL.Global{win:window||{},doc:document,nav:navigator,loc:location};SSL.Core.Dom{get:function(a){return document.getElementById(a)}};SSL.Core.Event{on:function(){}};SSL.App{_S_gConType:function(){var a;try{SSL.Global.doc.body.addBehavior(#default#clientCaps);aSSL.Global.doc.body.connectionType}catch(b){aunkown}return a},_S_gKeyV:function(g,b,d,c){if(g){return}if(c){c}bbc;var fg.indexOf(b);if(f0){return}ffb.length;var ag.indexOf(d,f);if(af){ag.length}return g.substring(f,a)},_S_gUCk:function(a){if((undefineda)||(a)){return}return SSL.App._S_gKeyV(SSL.Global.doc.cookie,a,;,)},_S_sUCk:function(e,a,b,d){if(a!null){if((undefinedd)||(nulld)){dsina.com.cn}if((undefinedb)||(nullb)||(b)){SSL.Global.doc.cookieea;domaind;path/}else{var cnew Date();var fc.getTime();ff86400000*b;c.setTime(f);fc.getTime();SSL.Global.doc.cookieea;domaind;expiresc.toUTCString();path/}}},_S_gJVer:function(f,b){var e,a,g,c1,d0;if(MSIEb){aMSIE;ef.indexOf(a);if(e0){gparseInt(f.substring(e5));if(3g){c1.1;if(4g){c1.3}}}}else{if((Netscapeb)||(Operab)||(Mozillab)){c1.3;aNetscape6;ef.indexOf(a);if(e0){c1.5}}}return c},_S_gFVer:function(nav){var uaSSL.Global.nav.userAgent.toLowerCase();var flash_version0;if(SSL.Global.nav.pluginsSSL.Global.nav.plugins.length){var pSSL.Global.nav.plugins[Shockwave Flash];if(typeof pobject){for(var i10;i3;i--){if(p.descriptionp.description.indexOf( i.)!-1){flash_versioni;break}}}}else{if(ua.indexOf(msie)!-1ua.indexOf(win)!-1parseInt(SSL.Global.nav.appVersion)4ua.indexOf(16bit)-1){for(var i10;i2;i--){try{var objecteval(new ActiveXObject(ShockwaveFlash.ShockwaveFlash.i););if(object){flash_versioni;break}}catch(e){}}}else{if(ua.indexOf(webtv/2.5)!-1){flash_version3}else{if(ua.indexOf(webtv)!-1){flash_version2}}}}return flash_version},_S_gMeta:function(b,c){var dSSL.Global.doc.getElementsByName(b);var a0;if(c0){ac}return(d.lengtha)?d[a].content:},_S_gHost:function(b){var anew RegExp(^http(?:s)?://([^/]),im);if(b.match(a)){return b.match(a)[1].toString()}else{return}},_S_gTJMTMeta:function(){return SSL.App._S_gMeta(mediaid)},_S_gTJZTMeta:function(){var aSSL.App._S_gMeta(subjectid);a.replace(,,.);a.replace(;,,);return a},_S_isFreshMeta:function(){return false},_S_isIFrameSelf:function(b,a){if(SSL.Global.win.topSSL.Global.win){return false}else{try{if(SSL.Global.doc.body.clientHeight0){return false}if((SSL.Global.doc.body.clientHeightb)(SSL.Global.doc.body.clientWidtha)){return false}else{return true}}catch(c){return true}}},_S_isHome:function(b){var a;try{SSL.Global.doc.body.addBehavior(#default#homePage);aSSL.Global.doc.body.isHomePage(b)?Y:N}catch(c){aunkown}return a}};function SUDA(I,h,g){var fSSL.Global,ySSL.Core.Dom,vSSL.Core.Event,jSSL.App;var Fwebbug_meta_ref_mod_noiframe_async_fc_:9.12c,k-9999-0-0-1;var bf.nav.appName.indexOf(Microsoft Internet Explorer)-1?MSIE:f.nav.appName;var uf.nav.appVersion;var qf.loc.href.toLowerCase();var zf.doc.referrer.toLowerCase();var p;var n,JSUP,w,tApache,xSINAGLOBAL,rULV,GUOR,s_s_upa,a320,l240,H0,o,m,M0,K10000,E0,d_s_acc;var Cq.indexOf(https)-1?https://:http://,Bbeacon.sina.com.cn,DCB/a.gif,LCB/e.gif;var e100,c2000;var A{_S_gsSID:function(){var Nj._S_gUCk(t);if(N){var Onew Date();NMath.random()*10000000000000.O.getTime();j._S_sUCk(t,N)}return N},_S_sGID:function(N){if(!N){j._S_sUCk(x,N,3650)}},_S_gGID:function(){return j._S_gUCk(x)},_S_gsGID:function(){var Nj._S_gUCk(x);if(N){NA._S_gsSID();A._S_sGID(N)}return N},_S_gCid:function(){try{var Nj._S_gMeta(publishid);if(!N){var PN.split(,);if(P.length0){if(P.length3){k-9999-0-P[1]-P[2]}return P[0]}}else{return0}}catch(O){return0}},_S_gAEC:function(){return j._S_gUCk(d)},_S_sAEC:function(N){if(N){return}var OA._S_gAEC();if(O.indexOf(N,)0){OON,}j._S_sUCk(d,O,7)},_S_p2Bcn:function(R,Q){var Pnew Date();var OQ?RgUid_P.getTime();var Nnew Image();SUDA.imgN;N.srcO},_S_gSUP:function(){if(w!){return w}var Punescape(j._S_gUCk(J));if(P!){var Oj._S_gKeyV(P,ag,,);var Nj._S_gKeyV(P,user,,);var Qj._S_gKeyV(P,uid,,);var Sj._S_gKeyV(P,sex,,);var Rj._S_gKeyV(P,dob,,);wO:N:Q:S:R;return w}else{return}},_S_gsLVisit:function(P){var Rj._S_gUCk(r);var QR.split(:);var S;if(Q.length6){if(P!Q[4]){var Onew Date();var Nnew Date(parseInt(Q[0]));Q[1]parseInt(Q[1])1;if(O.getMonth()!N.getMonth()){Q[2]1}else{Q[2]parseInt(Q[2])1}if(((O.getTime()-N.getTime())/86400000)7){Q[3]1}else{if(O.getDay()N.getDay()){Q[3]1}else{Q[3]parseInt(Q[3])1}}SQ[0]:Q[1]:Q[2]:Q[3];Q[5]Q[0];Q[0]O.getTime();j._S_sUCk(r,Q[0]:Q[1]:Q[2]:Q[3]:P:Q[5],360)}else{SQ[5]:Q[1]:Q[2]:Q[3]}}else{var Onew Date();S:1:1:1;j._S_sUCk(r,O.getTime()S:P:,360)}return S},_S_gUOR:function(){var Nj._S_gUCk(G);var ON.split(:);if(O.length2){return O[0]}else{return}},_S_sUOR:function(){var Rj._S_gUCk(G),W,O,V,Q;var X/[|?]cspr(_[A-Za-z0-9]{1,}){3,}/;var Snew Date();if(q.match(X)){Vq.match(X)[0]}else{if(z.match(X)){Vz.match(X)[0]}}if(V!){VV.substr(3):S.getTime()}if(R){if(j._S_gUCk(r)j._S_gUCk(r)){Wj._S_gHost(z);Oj._S_gHost(q)}j._S_sUCk(G,W,O,V,365)}else{var T0,UR.split(,);if(U.length1){WU[0]}if(U.length2){OU[1]}if(U.length3){QU[2]}if(V!){T1}else{var PQ.split(:);if(P.length2){var Nnew Date(parseInt(P[1]));if(N.getTime()(S.getTime()-86400000*30)){T1}}}if(T){j._S_sUCk(G,W,O,V,365)}}},_S_gRef:function(){var N/^[^\?#]*.swf([\?#])?/;if((z)||(z.match(N))){var Oj._S_gKeyV(q,ref,,);if(O!){return O}}return z},_S_MEvent:function(){if(M0){M;var Oj._S_gUCk(s);if(O){O0}O;if(OK){var N/[|?]cspr(_[A-Za-z0-9]{2,}){3,}/;if(q.match(N)||z.match(N)){OOK}}j._S_sUCk(s,O)}},_S_gMET:function(){var Nj._S_gUCk(s);if(N){N0}return N},_S_gCInfo_v2:function(){var Nnew Date();returnsz:screen.widthxscreen.height|dp:screen.colorDepth|ac:f.nav.appCodeName|an:b|cpu:f.nav.cpuClass|pf:f.nav.platform|jv:j._S_gJVer(u,b)|ct:j._S_gConType()|lg:f.nav.systemLanguage|tz:N.getTimezoneOffset()/60|fv:j._S_gFVer(f.nav)},_S_gPInfo_v2:function(N,O){if((undefinedN)||(N)){NA._S_gCid()k}returnpid:N|st:A._S_gMET()|et:E|ref:escape(O)|hp:j._S_isHome(q)|PGLS:j._S_gMeta(stencil)|ZT:escape(j._S_gTJZTMeta())|MT:escape(j._S_gTJMTMeta())|keys:},_S_gUInfo_v2:function(N){returnvid:N|sid:A._S_gsSID()|lv:A._S_gsLVisit(A._S_gsSID())|un:A._S_gSUP()|uo:A._S_gUOR()|ae:A._S_gAEC()},_S_gEXTInfo_v2:function(O,N){o(undefinedO)?o:O;m(undefinedN)?m:N;returnex1:o|ex2:m},_S_pBeacon:function(R,Q,O){try{var TA._S_gsGID();if(T){if(H1){setTimeout(function(){A._S_pBeacon(R,Q,O)},c);H;return}else{TA._S_gsSID();A._S_sGID(T)}}var VV2;var SA._S_gCInfo_v2();var XA._S_gPInfo_v2(R,A._S_gRef());var PA._S_gUInfo_v2(T);var NA._S_gEXTInfo_v2(Q,O);var WVCISPIXUIPEXN;A._S_p2Bcn(W,D)}catch(U){}},_S_acTrack_i:function(N,P){if((N)||(undefinedN)){return}A._S_sAEC(N);if(0P){return}var OAcTrack||A._S_gGID()||A._S_gsSID()||A._S_gSUP()||N||;A._S_p2Bcn(O,L)},_S_uaTrack_i:function(P,N){var OUATrack||A._S_gGID()||A._S_gsSID()||A._S_gSUP()||P||N||A._S_gRef()||;A._S_p2Bcn(O,L)}};if(M0){if(MSIEb){SSL.Global.doc.attachEvent(onclick,A._S_MEvent);SSL.Global.doc.attachEvent(onmousemove,A._S_MEvent);SSL.Global.doc.attachEvent(onscroll,A._S_MEvent)}else{SSL.Global.doc.addEventListener(click,A._S_MEvent,false);SSL.Global.doc.addEventListener(mousemove,A._S_MEvent,false);SSL.Global.doc.addEventListener(scroll,A._S_MEvent,false)}}A._S_sUOR();return{_S_pSt:function(N,P,O){try{if((j._S_isFreshMeta())||(j._S_isIFrameSelf(l,a))){return}E;A._S_gsSID();setTimeout(function(){A._S_pBeacon(N,P,O,0)},e)}catch(Q){}},_S_pStM:function(N,P,O){E;A._S_pBeacon(N,((undefinedP)?A._S_upExt1():P),O)},_S_acTrack:function(N,P){try{if((undefined!N)(!N)){setTimeout(function(){A._S_acTrack_i(N,P)},e)}}catch(O){}},_S_uaTrack:function(O,N){try{if(undefinedO){O}if(undefinedN){N}if((!O)||(!N)){setTimeout(function(){A._S_uaTrack_i(O,N)},e)}}catch(P){}},_S_gCk:function(N){return j._S_gUCk(N)},_S_sCk:function(Q,N,O,P){return j._S_sUCk(Q,N,O,P)},_S_gGlobalID:function(){return A._S_gGID()},_S_gSessionID:function(){return A._S_gsSID()}}}var GB_SUDA;if(GB_SUDAnull){GB_SUDAnew SUDA({})}var _S_PID_;function _S_pSt(a,c,b){GB_SUDA._S_pSt(a,c,b)}function _S_pStM(a,c,b){GB_SUDA._S_pStM(a,c,b)}function _S_acTrack(a){GB_SUDA._S_acTrack(a,1)}function _S_uaTrack(b,a){GB_SUDA._S_uaTrack(b,a)}(function(){function a(b,e,d){var cdocument.createElement(script);if(typeof estring){c.charsete}c.onreadystatechangec.onloadfunction(){if(!this.readyState||this.readyStateloaded||this.readyStatecomplete){if(etypeof efunction){e()}if(dtypeof dfunction){d()}c.onreadystatechangec.onloadnull;c.parentNode.removeChild(c)}};c.srcb;document.getElementsByTagName(head)[0].appendChild(c)}a(http://d3.sina.com.cn/shh/ws/2012/xb/gladnews_run.js)})();79 //--80 /script 81 script typetext/javascript 82 //!--83 GB_SUDA._S_pSt();84 //--85 /script 86 noScript 87 div styleposition:absolute;top:0;left:0;width:0;height:0;visibility:hiddenimg width0 height0 srchttp://beacon.sina.com.cn/a.gif?noScript border0 alt //div 88 /noScript 89 !-- SUDA_CODE_END --90 91 div idwrap92 !-- Header --93 div idheader94 h1em??°???????????±???é???§?/em/h195 ul96 lia hrefhttp://english.sina.com/index.html onclick_S_uaTrack(global_guide, english);Sina English/a/li97 /ul98 div classclearDiv/div99 /div
100
101 !-- Map --
102 div idmap
103 img srchttp://ui.sina.com/assets/img/www/worldmap.jpg alt namemap1 width775 height248 border0 usemap#Map1 idMap1 /
104
105 map nameMap1 id
106 area shaperect coords173,81,299,137 hrefhttp://home.sina.com target_self alt????????°??? title????????°??? onclick_S_uaTrack(global_guide, us); /
107 area shaperect coords468,81,572,129 hrefhttp://www.sina.com.cn target_self alt????????°??? title????????°??? onclick_S_uaTrack(global_guide, beijing); /
108 area shaperect coords482,145,578,184 hrefhttp://www.sina.com.hk target_self alté???????°??? titleé???????°??? onclick_S_uaTrack(global_guide, hongkong); /
109 area shaperect coords658,123,755,162 hrefhttp://www.sina.com.tw target_self alt??°?????°??? title??°?????°??? onclick_S_uaTrack(global_guide, taipei); /
110 /map
111 /div
112
113 !-- Channels --
114 div idchannel
115 img srchttp://ui.sina.com/assets/img/www/categories-120918.gif alt width775 height44 border0 usemap#Map4 idMap4 /
116
117 map nameMap4 id
118 area shaperect target_self alt?????? coords4,3,76,35 hrefhttp://us.weibo.com onclick_S_uaTrack(global_guide, weibo); /
119 area shaperect target_self alt?????? coords95,3,166,37 hrefhttp://google.sina.com/ onclick_S_uaTrack(global_guide, search); /
120 area shaperect target_self altè??é?? coords171,2,241,38 hrefhttp://video.sina.com onclick_S_uaTrack(global_guide, video); /
121 area shaperect target_self alt??¤??? coords257,3,328,39 hrefhttp://match.sina.com/ onclick_S_uaTrack(global_guide, match); /
122 area shaperect target_self alt???é?? coords432,3,496,36 hrefhttp://travel.sina.com/ onclick_S_uaTrack(global_guide, travel); /
123 area shaperect target_self alté??é?? coords509,2,582,35 hrefhttp://yp.sina.com/ onclick_S_uaTrack(global_guide, yellow); /
124 area shaperect target_self alt????????? coords590,2,679,33 hrefhttp://sina.echineselearning.com/ onclick_S_uaTrack(global_guide, chinese); /
125 area shaperect target_self altè????? coords335,3,417,38 hrefhttp://bbs.sina.com/ onclick_S_uaTrack(global_guide, bbs); /
126 area shaperect target_self alt?????? coords688,1,772,35 hrefhttp://deals.sina.com onclick_S_uaTrack(global_guide, deals); /
127 /map
128 /div
129
130 !-- ads (banners/buttons) --
131 div idads
132 ul
133 li classbnr728!-- Row 1 . 728x90 --
134 script typetext/javascript
135 //![CDATA[
136 ord window.ord || Math.floor(Math.random()*1E16);
137 document.write(script typetext/javascript srchttp://ad.doubleclick.net/adj/us.homepage/;postop;sz728x90;ord ord ?\/script);
138 //]]
139 /script
140 noscripta hrefhttp://ad.doubleclick.net/jump/us.homepage/;postop;sz728x90;ord123456789? target_blank img srchttp://ad.doubleclick.net/ad/us.homepage/;postop;sz728x90;ord123456789? border0 alt //a/noscript
141 !-- END . Row 1 . 728x90 --
142
143 /li
144
145 li classbnr120script typetext/javascript srchttp://dailynews.sina.com/gb/ads/www/120_60/2.js/script/li
146 li classbnr120script typetext/javascript srchttp://dailynews.sina.com/gb/ads/www/120_60/3.js/script/li
147 li classbnr120script typetext/javascript srchttp://dailynews.sina.com/gb/ads/www/120_60/4.js/script/li
148 li classbnr120script typetext/javascript srchttp://dailynews.sina.com/gb/ads/www/120_60/5.js/script/li
149 li classbnr120script typetext/javascript srchttp://dailynews.sina.com/gb/ads/www/120_60/6.js/script/li
150
151 li classbnr120script typetext/javascript srchttp://dailynews.sina.com/gb/ads/www/120_60/7.js/script/li
152 li classbnr120script typetext/javascript srchttp://dailynews.sina.com/gb/ads/www/120_60/8.js/script/li
153 li classbnr120script typetext/javascript srchttp://dailynews.sina.com/gb/ads/www/120_60/9.js/script/li
154 li classbnr120script typetext/javascript srchttp://dailynews.sina.com/gb/ads/www/120_60/10.js/script/li
155 li classbnr120script typetext/javascript srchttp://dailynews.sina.com/gb/ads/www/120_60/11.js/script/li
156
157 /ul
158
159 div classclearDiv/div
160 /div
161 !-- END . ads --
162
163 !-- Footer --
164 div idfooter
165 ul
166 lia hrefhttp://corp.sina.com.cn/eng/About SINA/a/li
167 li|/li
168 lia hrefhttp://corp.sina.com.cn/eng/sina_rela_eng.htmInvestor/a/li
169 li|/li
170 lia hrefhttp://mediakit.sina.com/Media Kit/a/li
171 li|/li
172 lia hrefhttp://mediakit.sina.com/contact.htmlComments or Question?/a/li
173 br /br /
174 li classcopyrightCopyright copy; 1996-2015 SINA Corporation, All Rights Reserved/li
175 /ul
176 /div
177
178 /div
179
180 !--floating video--
181 div idflvideo
182 script typetext/javascript srchttp://dailynews.sina.com/gb/ads/common/floatingvideo.js/script
183 /div
184
185 !-- START Nielsen Online SiteCensus V6.0 --
186 script typetext/javascript src//secure-us.imrworldwide.com/v60.js/script
187 script typetext/javascript
188 var pvar { cid: us-sina, content: 0, server: secure-us };
189 var feat { surveys_enabled: 1, sample_rate: 0.1 };
190 var trac nol_t(pvar, feat);
191 trac.record().post().do_sample();
192 /script
193 noscript
194 div
195 img src//secure-us.imrworldwide.com/cgi-bin/m?cius-sinaamp;cg0amp;cc1amp;tsnoscript width1 height1 alt /
196 /div
197 /noscript
198 !-- END Nielsen Online SiteCensus V6.0 --
199
200 /body
201 /html HTML Code OK这样就可以抓到网站主页的数据了。现在的HttpClient对于gzip格式的响应解析做得很好在内部就解压缩了不需要使用者做特殊处理。 后续还需要做一个桌面的应用能够隔几分钟轮询页面并将所需部分内容是否更新的状态通知给用户的功能。 转载于:https://www.cnblogs.com/dsdk2008/p/4745243.html
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/81582.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!