質問

私はphpquery(jqueryのとほぼ同じ)を使用して、ページをオフ解析データにしようとしています、

私はこれらの2つのことを取得するコードが必要、

B K Guda協会ホール

主要道路、C型コロニー、B K Guda

他のものを除外することができます..

これは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>
役に立ちましたか?

解決

いかがます:

pq('div')->remove();
pq('form')->remove();
$text1 = pq('a')->text();
pq('a').remove();
$text2 = pq('td').text();
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top