开发者

PHPQuery -> WebBrowser Example 2 won't work [still looking for answer]

开发者 https://www.devze.com 2023-02-16 06:35 出处:网络
I can\'t seem to get this code working phpQuery::$ajaxAllowedHosts = \'google.com\'; phpQuery::browserGet(\'http://www.google.com/\', \'success1\');

I can't seem to get this code working

phpQuery::$ajaxAllowedHosts = 'google.com'; 
phpQuery::browserGet('http://www.google.com/', 'success1');
function success1($browser) {
  $browser
    ->W开发者_JS百科ebBrowser('success2')
    ->find('input[name=q]')
      ->val('search phrase')
      ->parents('form')
        ->submit();
}
function success2($browser) {
  print $browser;
}

It's example 2 from this page:http://code.google.com/p/phpquery/wiki/WebBrowser

All it does is just output blank.

Can someone see anything I am doing wrong?

Thanks


You've allowed the google.com.au host then made a request to a different host google.com.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号