phpQuery忽略导入文件的一部分 [英] phpQuery ignores part of an imported file

查看:90
本文介绍了phpQuery忽略导入文件的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码:

the following code:

<?
  require_once "phpQuery.php";
  $dom = phpQuery::newDocument( "<head></head><body>this is ignored</body>" );
  echo nl2br( htmlentities( $dom ) );
?>

应该给这个忽略,但是整个身体似乎被忽略了。

should give this is ignore, but the entire body seems to be ignored.

我将代码分解到问题仍然存在的地方。我想从正文中读取链接($ dom-> find('a')),但发现没有任何东西被发现,即使在正文中有链接。

I stripped down the code to where the problem was still there. I want to read links ($dom->find('a')) from the body, but found out nothing was found even though there were links in the body.

我在做什么错误?

What am I doing wrong?

推荐答案

xml的身体?如果是这样,您应该将文档包装在< html> 标签中。

Does phpquery require valid xml bodies? If so, you should wrap your document in a <html> tag.

这篇关于phpQuery忽略导入文件的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆