views:

61

answers:

1

Hi,

I am trying to parse data off a page using phpquery(almost same as jquery),

I need code to get these 2 things,

B K Guda Association Hall

and

Main Road, C Type Colony, B K Guda

other things can be left out..

this is the 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"&gt;&lt;u&gt;Rate&lt;/u&gt;&lt;/a&gt; • <a href="javascript:savesubmit('form42918','results42918','','locations',%20'42918')"><u>Save</u></a> • <a href="http://www.fullhyderabad.com/profile/locations/42918/4"&gt;&lt;u&gt;Map&lt;/u&gt;&lt;/a&gt;          <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>
A: 

How about:

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