【问题标题】:jQuery filtering and traversing (phpQuery)jQuery过滤和遍历(phpQuery)
【发布时间】:2010-01-28 11:50:29
【问题描述】:

我正在尝试使用 phpquery(几乎与 jquery 相同)从页面中解析数据,

我需要代码来获取这两件事,

B K古达会馆

主路,C型殖民地,B K古达

其他的可以省略..

这是html

<td> 
<a href="#...">
    <span class="a12bl">
        <u>
            <h2 class="bold">B K Guda Association Hall</h2>
        </u>
    </span>
</a>
Main Road, C Type Colony, B K Guda          <br>



            <!--filter this out...-->

            <div style="float: left;" id="42918save"> 
<a href="http://www.fullhyderabad.com/profile/locations/42918/1#tabs"><u>Rate</u></a> • <a href="javascript:savesubmit('form42918','results42918','','locations',%20'42918')"><u>Save</u></a> • <a href="http://www.fullhyderabad.com/profile/locations/42918/4"><u>Map</u></a>          <div style="clear: both;"></div>
            </div>
            <!--AJAX MAIN DIV END-->
            <form style="margin: 0px;" name="deleteform42918">
                <input type="hidden" value="42918" name="eventid">
                <input type="hidden" value="delete" name="edittype">
            </form>
            <form style="margin: 0px;" name="form42918">
                <input type="hidden" value="42918" name="eventid">
                <input type="hidden" value="update" name="edittype">
            </form>

            <div style="clear: both;"></div>
            <div id="results42918">
                        </div>
</td>

【问题讨论】:

    标签: php javascript jquery phpquery


    【解决方案1】:

    怎么样:

    pq('div')->remove();
    pq('form')->remove();
    $text1 = pq('a')->text();
    pq('a').remove();
    $text2 = pq('td').text();
    

    【讨论】:

      猜你喜欢
      • 2015-03-05
      • 2011-01-21
      • 1970-01-01
      • 2018-08-14
      • 1970-01-01
      • 1970-01-01
      • 2016-01-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多