请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

数据库中的content内容与es中的不同

老师,知乎问题的content爬取,按照您课上的截图,您获取的content如下:图片描述

在数据库中的content内容显示的时候有下面这种标签,
<div class="QuestionHeader-detail"> <div class="QuestionRichText QuestionRichText--expandable QuestionRichText--collapsed"><div><span class="RichText ztext" itemprop="text"></span><button type="button" class="Button QuestionRichText-more Button--plain"><svg viewbox="0 0 10 6" class="Icon QuestionRichText-more-icon Icon--arrow" style="height:16px;width:10px" width="10" height="16" aria-hidden="true"><title></title><g><path d="M8.716.217L5.002 4 1.285.218C.99-.072.514-.072.22.218c-.294.29-.294.76 0 1.052l4.25 4.512c.292.29.77.29 1.063 0L9.78 1.27c.293-.29.293-.76 0-1.052-.295-.29-.77-.29-1.063 0z"></path></g></svg></button></div></div></div>
但是在es中显示时,就没有这些tag标签了呢,如下图:

图片描述

正在回答 回答被采纳积分+3

1回答

bobby 2019-06-11 10:00:32

入库es的时候有没有自己去掉这些tag? 以及你可以使用kibana查询一条数据看看kibana中显示的数据是不是有html的标签?

0 回复 有任何疑惑可以回复我~
  • 提问者 战战的坚果 #1
    入库es的时候自动去掉了这些tag,但是入mysql的时候没有去掉
    回复 有任何疑惑可以回复我~ 2019-06-13 20:25:44
  • bobby 回复 提问者 战战的坚果 #2
    那就在入口es的时候不要去掉tag就行了
    回复 有任何疑惑可以回复我~ 2019-06-14 18:23:11
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号