oLovingyou1 2016-06-11 05:35 采纳率: 50%
浏览 1579
已采纳

php怎样获取循环html标签

比如一个页面内有很多这样循环的html代码:

                                                                                            <div class="weiboShow_mainFeed_list clearfix" goSrc="http://baidu.com">
                                <div class="weiboShow_mainFeed_list_wrap clearfix">
                                    <div class="weiboShow_mainFeed_listContent">
                                        <p class="weiboShow_mainFeed_listContent_txt">我</p>
                                                                                    <!-- 图片 -->
                                                                                    <!-- 图片 -->
                                                                                    <p class="weiboShow_mainFeed_listContent_action WB_linkB"><span class="weiboShow_mainFeed_listContent_actionTime"><a href="http://baidu.com" target="_blank">5月1日 16:06</a></span><span class="weiboShow_mainFeed_listContent_actionMore"><a href="http://baidu.com" target="_blank">转发</a><em class="weiboShow_vline">|</em><a href="http://baidu.com" target="_blank">评论</a></span></p>
                                    </div>
                                </div>
                            </div>

现在我要循环获取.weiboShow_mainFeed_listContent_txt和.weiboShow_mainFeed_listContent_actionTime的内容,并且能指定获取几个,这样该怎么写?

  • 写回答

1条回答 默认 最新

  • JPF1024 2016-06-11 05:59
    关注

    你是要抓取吗?参考:http://www.jb51.net/article/46459.htm

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 ensp路由器启动不了一直报#
  • ¥50 安卓10如何在没有root权限的情况下设置开机自动启动指定app?
  • ¥15 ats2837 spi2从机的代码
  • ¥200 wsl2 vllm qwen1.5部署问题
  • ¥100 有偿求数字经济对经贸的影响机制的一个数学模型,弄不出来已经快要碎掉了
  • ¥15 数学建模数学建模需要
  • ¥15 已知许多点位,想通过高斯分布来随机选择固定数量的点位怎么改
  • ¥20 nao机器人语音识别问题
  • ¥15 怎么生成确定数目的泊松点过程
  • ¥15 layui数据表格多次重载的数据覆盖问题