class不一致时候,解析规则

l

[<span class="author-link-line">
<a class="author-link" data-hovercard="p$t$hui-yi-zui-hou" href="/people/hui-yi-zui-hou" target="_blank">我是一只小萌刀</a></span>, <span class="author-link-line">
<span class="name">知乎用户</span></span>, <span class="author-link-line">
<a class="author-link" data-hovercard="p$t$tut_mok" href="/people/tut_mok" target="_blank">莫毒枭</a></span>, <span class="author-link-line">
<a class="author-link" data-hovercard="p$t$su-fei-17" href="/people/su-fei-17" target="_blank">苏菲</a><span class="icon icon-badge-best_answerer icon-badge" data-tooltip="s$b$优秀回答者"></span></span>, <span class="author-link-line">
<a class="author-link" data-hovercard="p$t$xiao-zhu-12-40-56" href="/org/xiao-zhu-12-40-56" target="_blank">小猪</a><span class="OrgIcon sprite-global-icon-org-14" data-tooltip="s$b$已认证的官方帐号"></span></span>, <span class="author-link-line">
<a class="author-link" data-hovercard="p$t$shui-zhu-31" href="/people/shui-zhu-31" target="_blank">水烛</a></span>, <span class="author-link-line">
<a class="author-link" data-hovercard="p$t$chen-jia-xin-99-40-43" href="/people/chen-jia-xin-99-40-43" target="_blank">山河</a></span>, <span class="author-link-line">
<a class="author-link" data-hovercard="p$t$yuzheng-wang-78" href="/people/yuzheng-wang-78" target="_blank">Yuzheng Wang</a></span>, <span class="author-link-line">
<a class="author-link" data-hovercard="p$t$hsuvon" href="/people/hsuvon" target="_blank">南枫Von</a></span>, <span class="author-link-line">
<a class="author-link" data-hovercard="p$t$zhong-nan-42-70-70" href="/people/zhong-nan-42-70-70" target="_blank">中南</a></span>]

取出用户名

author的class,有的是
class="author-link"
有的是
class="name"
posted @ 2018-07-01 02:54  王琳杰  阅读(258)  评论(0编辑  收藏  举报