kjenney
asked on
QueryPath Extract from DIV class
I'm working with a simple example to try to understand how QueryPath (DOM) handles elements in a page. Here is the example:
I've got this so far:
How do I output the contents of the img/title (as seen above: "Test Title")?
<html>
<head><title>Test</title></head>
<body>
<div class="pup">
<img title="Test Title" src="myimage.jpg">
</div>
</body>
</html>
I've got this so far:
$testqp = htmlqp('test.html','body');
$header = $testqp->find('div[class="pup"]->img->title')->text();
echo $header;
How do I output the contents of the img/title (as seen above: "Test Title")?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great!
Cheers- that's funny, I was about to post that same change :)
Glad you got it working!
Glad you got it working!
ASKER
Open in new window