日期:2014-05-16  浏览次数:20655 次

PHP如何采集网页指定标签里面的数据
本帖最后由 chemstudy2 于 2014-03-29 21:07:24 编辑
PHP采集问题,如何采集源码中ul标签里的数据,并写入本地数据库:

对方网页某一段源码如下:
 <ul class="priceTableRows">             

                         
                                  <li class="cq">
                                    <span class="w1"><a href="http://www.xxxx.cn/exchange-priceItem-290-1-0.html" title=" 鸡骨草" target="_blank"> 鸡骨草</a></span>
                                    <span class="w2"><a href="http://www.xxxx.cn/exchange-prices-290-1-29001.html?t=1" title=" 大叶全草 广西" target="_blank"> 大叶全草 广西</a></span>
                                    <span class="w9">亳州</span>
                                    <span class="w3">17.00</span>
                                     <span class="w4">平</span>
                                    <span class="w5"><em class="up">126.67%</em></span>
                                    <span class="w6"><em class="up">126.67%</em></span>
                                    <span class="w7"><em class="up">286.36%</em></span>
                                    <span class="w8"><a  href="http://www.xxxx.cn/exchange-prices-290-1-29001.html?t=1"  title=" 鸡骨草" target="_blank"><img src="http://img.zyctd.com/MarketCondition/icon_chart.gif" /></a></span>
                                </li> &