html - Getting unstyled text using QueryPath in PHP -
i'm getting grips querypath after using html simple dom quite time , finding qp documentation doesn't seem offer in way of examples of functions.
at moment i'm trying retrieve text html doc doesn't make use of id's or classes, i'm little outside of comfort zone.
here's html:
<div class="blue-box"> <div class="top"> <h2><img src="pic.gif" alt="advertise"></h2> <p>some uninteresting stuff</p> <p>more stuff</p> </div> </div> <div class="blue-box"> <div class="top"> <h2><img src="pic2.gif" alt="location"></h2> **i need text** <div style="margin:stuff"> <img src="img3.gif"> </div> </div> </div>
i thinking selecting class 'box-blue' starting point , descending there. issue there number of box-blue classes in html doc.
therefore thinking maybe should try select image alt="location" , use ->next()->text() or along lines?
i've tried 15 variations os far , none getting text need.
assistance appreciated!
can have example http://jsfiddle.net/pedro3m/mujtk/
i made said using alt attribute, if confirm if unique
$("img[alt='location']").parent().parent().text();
Comments
Post a Comment