爬虫获取精确的前端数据

 

<div riot-tag="statistics">
    <dl class="statistics">
        <dt><a ga_event="nav_user_list" href="/c/user/relation/5580516419/?tab=following"><h3 riot-tag="number"
                                                                                              number="8"><em
                class="y-number"><i>8</i></em></h3>
            <p>关注</p></a></dt>
        <dd><a ga_event="nav_user_list" href="/c/user/relation/5580516419/?tab=followed"><h3 riot-tag="number"
                                                                                             number="418400"><em
                class="y-number"><i>41</i>万</em></h3>
            <p>粉丝</p></a></dd>
    </dl>
</div>

  

 

        u_following, u_followed = [i.get_attribute('number') for i in
                                   browser.find_element_by_id('wrapper').find_element_by_class_name(
                                       'right').find_elements_by_tag_name('h3')]

  

 

posted @ 2018-05-22 18:16  papering  阅读(232)  评论(0编辑  收藏  举报