为什么我这里执行了fmt.ptintf("%s\n",all)之后终端获取的页面信息是没有格式的:
来源:15-1 获得初始页面内容

心猿意了个码
2020-09-26
hirdClassList":[{“hotThirdClassContent”:“老年女人征婚”,“hotThirdClassURL”:“http:\u002F\u002Fwww.zhenai.com\u002Fzhuanti\u002Flnnrzh187”},{“hotThirdClassContent”:“中老年联谊会”,“hotThirdClassURL”:“http:\u002F\u002Fwww.zhenai.com\u002Fzhuanti\u002Fzlnlyh41127”},{“hotThirdClassContent”:“找个单身孤独老人”,“hotThirdClassURL”:“http:\u002F\u002Fwww.zhenai.com\u002Fzhuanti\u002Fzgdsgdlr41150”},{“hotThirdClassContent”:“交口男中老年单身”,“hotThirdClassURL”:“http:\u002F\u002Fwww.zhenai.com\u002Fzhuanti\u002Fjknzlnds41126”},{“hotThirdClassContent”:“中年男诚意征婚”,“hotThirdClassURL”:“http:\u002F\u002Fwww.zhenai.com\u002Fzhuanti\u002Fznncyzh40909”},{“hotThirdClassContent”:“老年女士相亲网”,“hotThirdClassURL”:“http:\u002F\u002Fwww.zhenai.com\u002Fzhuanti\u002Flnnsxqw40991”},{“hotThirdClassContent”:“老年人想找一个伴”,“hotThirdClassURL”:“http:\u002F\u002Fwww.zhenai.com\u002Fzhuanti\u002Flnrxzygb41149”},{“hotThirdClassContent”:“65岁男退休找老伴”,“hotThirdClassURL”:“http:\u002F\u002Fwww.zhenai.com\u002Fzhuanti\u002F65sntxzlb41144”},{“hotThirdClassContent”:“65岁丧偶男士个人征婚”,“hotThirdClassURL”:“http:\u002F\u002Fwww.zhenai.com\u002Fzhuanti\u002F65ssonsgrzh1008”},{“hotThirdClassContent”:“我48岁女想找个老伴”,“hotThirdClassURL”:“http:\u002F\u002Fwww.zhenai.com\u002Fzhuanti\u002Fw48snxzglb41145”}]}};(function(){var s;(s=document.currentScript||document.scripts[document.scripts.length-1]).parentNode.removeChild(s);}());<script type=“text/javascript” src="//i.zhenai.com/common/m/base/js/vue.min.2.5.16.js"><script type=“text/javascript” src="//i.zhenai.com/common/m/base/js/zhenai-1.5.9.min.js"><script type=“text/javascript”>window.Z&&Z.tj&&Z.tj.pv&&(Z.setUAPlatform(1),Z.tj.pv({forDc:!0}))<script type=“text/javascript” src="//i.zhenai.com/pc/seo/zhenghun/static/js/zhenghun.d2ee2fda872b048d2907.js">"
1回答
-
ccmouse
2020-09-28
这个很正常,数据只要浏览器能解码就行,是不是有格式没有要求。网站有可能把页面源码改成了没有格式的,可以省下一些空格换行之类的内容。
这里我们可以贴到任何能够进行HTML编辑的编辑器或IDE里,让它格式化即可。
00
相似问题