technosophos / querypath

QueryPath is a PHP library for manipulating XML and HTML. It is designed to work not only with local files, but also with web services and database resources.
http://querypath.org
Other
824 stars 115 forks source link

QueryPath\Exception: Unsupported class type: Masterminds\HTML5 #142

Open danielbachhuber opened 10 years ago

danielbachhuber commented 10 years ago

Using more or less the pattern documented on the homepage:

use Masterminds\HTML5;
$html5 = new HTML5();
$dom = $html5->loadHTML($html);
qp($dom, '#row2>td:nth(3)')->text();

It looks like the class needs to be whitelisted here: https://github.com/technosophos/querypath/blob/6c677d0158a85ea4632073b19502db92a91c3243/src/QueryPath/DOMQuery.php#L120

technosophos commented 10 years ago

You're right. If you have a minute to issue a pull request, that'd be great. Otherwise, I'm a little stalled on QueryPath work and probably won't get to it until next week.