我认为问题可能是您的 phpQuery 调用::newDocumentFile()
。此函数需要一个文件名(不确定 URL 是否有效),但我怀疑您->getPage()
实际上已经获取了该文件。如果是这样,那么::newDocument()
像这样使用正常:
$html = file_get_contents("http://www.yahoo.com/");
$pq = phpQuery::newDocument($html);
print $pq->find("title")->text();
为我工作。