lang
1<?php 2 require_once('phpQuery-onefile.php'); 3 $doc = phpQuery::newDocumentFile('http://yahoo.co.jp'); 4 $title = $doc["title"]->text(); 5 print($title);
cakephpのShellでphpQueryを使って上のような事がやりたいのですが、調べて色々試してみましたが上手くいきませんでした。下が作成したプログラムです。
lang
1<?php 2namespace App\Shell; 3App::import('Vendor', 'phpQuery'); 4class TestShell extends Shell 5{ 6 public function main() 7 { 8 $doc = phpQuery::newDocumentFile('http://yahoo.co.jp'); 9 $title = $doc["title"]->text(); 10 print($title); 11 } 12}
またphpQuery-onefile.phpは名前をphpQuery.phpに変更してcakephp\vendorの下に保存しました。おかしいとこが沢山あるかと思いますがどうかよろしくお願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。